→ nobody1: new TextView(); new EditText(); 01/26 12:47
推 sofasoso: 看不太懂你想問什麼 你是想問動態產生元件? 01/26 17:37
推 mantoro: if(stringA.equal("textview")) new TextView xxx...?? 01/26 18:32
對 跟樓上的敘述沒錯 我得到string "textview",
要直接利用string "textview" 去add textview
想問有沒有可以直接轉換的方法 因為有很多需要判別的view
※ 編輯: nibeba (140.112.45.109), 01/27/2015 11:44:54
→ ssccg: Class.forName("android.widget.TextView").getConstructor 01/27 12:51
推 asilzheng: 看一下 Class 與 Constructor 兩個的 API ,應該可用 01/27 12:51
→ ssccg: (Context.class).newInstance(ctx) 01/27 12:51