我创建了一个类似的LinearLayout下面的TextView。该文本是可变的。如果这些元素变得大于布局宽度它变得肮脏。我想有文本流到新行只是一个会写一本书的时候做的。这可能吗?
<的LinearLayout
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT>
<的TextView
机器人:ID =@ + ID / textView1
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文本=XX
机器人:textAppearance =:/>中的Android ATTR / textAppearanceSmall?
< EditText上...>
<的TextView
机器人:ID =@ + ID / textView2
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文本=XX
机器人:textAppearance =:/>中的Android ATTR / textAppearanceSmall?
< / LinearLayout中>
坦克!
修改
是这样的:
textview1text的EditText textview2 textview2continuesin2ndrow不喜欢这样的:
textview1text的EditText textview2text textview1cont 解决方案尝试像...
< LinearLayout中的xmlns:机器人=http://schemas.android.com/apk/res/android
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT>
<的LinearLayout
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =FILL_PARENT>
<的TextView
机器人:ID =@ + ID / textView1
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:文本=XX
机器人:textAppearance =:/>中的Android ATTR / textAppearanceSmall?
< EditText上...>
< / LinearLayout中>
<的LinearLayout
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =FILL_PARENT
机器人:方向=垂直>
<的TextView
机器人:ID =@ + ID / textView2
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =FILL_PARENT
机器人:文本=XX
机器人:textAppearance =:/>中的Android ATTR / textAppearanceSmall?
< / LinearLayout中>
< / LinearLayout中>
I created a LinearLayout like below with TextView. The Text is variable. If the Elements gets bigger than the Layout width it gets nasty. I want to have the text flow to a new line just one would do when writing a book. Is this possible?
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="xx"
android:textAppearance="?android:attr/textAppearanceSmall" />
<EditText ...>
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="xx"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
Tanks!
edit
like this:
textview1text edittext textview2 textview2continuesin2ndrownot like this:
textview1text edittext textview2text textview1cont解决方案
Try something like...
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="xx"
android:textAppearance="?android:attr/textAppearanceSmall" />
<EditText ...>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="xx"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</LinearLayout>