2017-10-06 133 views
0
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(hello); 我得到错误不能将字符串转换为字符[]错误xamarin android

+0

应该能够使用hello.ToCharArray() – Joagwa

+0

你什么错误?你期望我们猜测什么? – perror

回答

0

使用Text属性

ch.Text = hello;