📌  相关文章
📜  如何在 android 中以编程方式创建 textview - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:17.743000             🧑  作者: Mango

代码示例1
String[] textArray = {"One", "Two", "Three", "Four"};
LinearLayout linearLayout = new LinearLayout(this);
setContentView(linearLayout);
linearLayout.setOrientation(LinearLayout.VERTICAL);        
for( int i = 0; i < textArray.length; i++ )
{
    TextView textView = new TextView(this);
    textView.setText(textArray[i]);
    linearLayout.addView(textView);
}