我正在尝试在片段中添加一个很长的文本(Glgamesh 的史诗)。
我的 xml 版本:
<LinearLayout.LayoutParams xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:context=".viewOne">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/epica"
android:text=" **I WILL INSERT HERE THE WHOLE TEXT?**" />
</LinearLayout.LayoutParams>
还有什么是java部分?我必须重写 setText 中的内容吗?凭身份证能回忆起来吗?
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dynamic_linearlayout);
LinearLayout linearLayout = (LinearLayout) findViewById(R.id.epica);
TextView textView = new TextView(this);
textView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
嘿,谢谢!
森栏
相关分类