2017-10-06 134 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;