2013-05-16 70 views
0

我想在我的LinearLayout中添加多行TextView。以下是我的代码,但它不起作用。在设备上它只显示单行。Android:水平LinearLayout中的多行TextView

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:gravity="right" 
    android:orientation="horizontal"> 
    <ImageView 
    android:id="@+id/file_picker_image" 
    android:layout_width="40dip" 
    android:layout_height="40dip" 
    android:layout_marginTop="10dip" 
    android:layout_marginBottom="5dip" 
    android:layout_marginLeft="5dip" 
    android:src="@drawable/file" 
    android:scaleType="centerCrop"/> 

    <TextView 
    android:id="@+id/file_picker_text" 
    android:layout_width="fill_parent" 
    android:layout_height="60dip" 
    android:layout_weight="1" 
    android:layout_gravity="left|center_vertical" 
    android:textSize="18sp" 
    android:layout_marginLeft="10dip" 
    android:layout_marginRight="10dip" 
    android:layout_marginTop="10dip" 
    android:singleLine="false" 
    android:maxLines="2" 
    android:lines="2" 
    android:text="Multiline text here"/> 

</LinearLayout> 
+0

工作正常,我于二OO星系ÿ测试 –

回答

0

它的工作对我很好,尽量把更多的字符,如文本:

android:text="Multiline text here with more characters uhuuuuu" 
相关问题