Textview未在Phone.linear布局上显示完整文本

时间:2011-06-16 08:00:58

标签: android textview android-linearlayout

我有线性布局。里面有textview.which sometiomes包含大量信息。 在PC上如果使用模拟器运行应用程序它工作正常但在手机上整个文本没有显示。 左侧文字消失了,不能,它只显示1行。 我认为文字包装不起作用。

     android:scrollHorizontally="true"

机器人:ellipsize = “结束” 机器人:ellipsize = “字幕”

我厌倦了但没有工作

需要紧急帮助

2 个答案:

答案 0 :(得分:4)

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<EditText  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    android:id="@+id/Text1"
    />


</LinearLayout>

试试这个......

使用此代码时无需滚动屏幕。

答案 1 :(得分:0)

只需将TextView放在ScrollView中即可:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/white">
    <ScrollView android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:scrollbars="vertical"> 
        <TextView android:id="@+id/about_detail"
            android:layout_height="fill_parent"
            android:layout_width="match_parent"
            android:padding="2dp"
            android:textSize="16dp"
            android:textColor="@android:color/black"
            android:background="@color/white"/>
    </ScrollView>     
</LinearLayout>

希望这有效\