无法将字符串转换为char []错误xamarin android

时间:2017-10-06 10:40:05

标签: android xamarin

 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(你好); 我收到了错误

1 个答案:

答案 0 :(得分:0)

使用Text属性

ch.Text = hello;