问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图
tableRow.LayoutParameters = new TableLayout.LayoutParams(TableLayout.LayoutParams.FillParent,
TableLayout.LayoutParams.WrapContent);
public Button AddButton(Context context, string text,Android.Graphics.Color 背景色 ,EventHandler clickAction = null)
{
var btn = new Button(context);
btn.SetBackgroundColor(背景色);
btn.SetText(text, TextView.BufferType.Normal);
btn.SetPadding(5, 5, 5, 5);
btn.SetHeight(40);
if (clickAction != null)
{
btn.Click += clickAction;
}
return btn;
}
public TextView NewText(Context context, string str, Android.Graphics.Color 字体颜色, Android.Graphics.Color 背景色)
{
var textView = new TextView(context);
textView.SetHeight(88);
if (字体颜色 != null)
{
textView.SetBackgroundColor(背景色);
textView.SetTextColor(字体颜色);
textView.SetPadding(5, 5, 5, 5);
}
textView.SetText(str, TextView.BufferType.Normal);
return textView;
}
tableRow.AddView(_dynaControl.AddButton(this, string.Format("{0} ", "编辑订单"), Android.Graphics.Color.Red, Bt_编辑Click));
tableRow.AddView(_dynaControl.AddButton(this, string.Format("{0} ", "删除订单"), Android.Graphics.Color.Gold, Bt_删除Click));
tableRow.AddView(_dynaControl.AddButton(this, string.Format("{0} ", "删除订单"), Android.Graphics.Color.White, Bt_删除Click));
运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果
如何设置边框