string hello = "hello";
for (int i = 0; i < 2; i++)
{
CheckBox ch = new CheckBox(this);
ch.SetText(hello);
layout.AddView(ch);
}
我在stackoverflow上看到几个线程,他们能够做到上面的步骤,我不能在xamarin android中做到这一点吗? ch.SetText(你好); 我收到了错误
答案 0 :(得分:0)
使用Text属性
ch.Text = hello;