显示TextView中的问题

时间:2011-04-21 04:42:02

标签: android android-emulator android-layout android-widget

我在我的应用程序中完成了一个布局我有TextView,并且我必须显示段落。现在i9已将所有包含设置为XML文件,如下面的代码。但它看不到全文和该段的最后一行被删除。 。 。我该怎么做呢? 帮我。 。 。谢谢。 代码:

<LinearLayout
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
        android:orientation="vertical"
        >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"

            >
            <Button
                android:layout_height="35dip"
                android:layout_width="wrap_content"
                android:text="1973"
                android:textColor="#ffffff"
                android:layout_marginTop="7dip"
                android:background="@drawable/histry"/>
            <TextView
                    android:layout_height="100dip"
                    android:layout_width="wrap_content"
                    android:textSize="12px"
                    android:layout_marginLeft="5dip"
                    android:singleLine="false"

                    android:text="Tony Collier, a cook at the Grandview Foundation in Pasadena, begins collecting and distributing food. Collier receives more food donations from local businesses than anticipated and he shares the food with other organizations helping the hungry.  Collier begins the first search for a larger facility by moving the small operation into a two-car garage."/>

        </LinearLayout>     

    </LinearLayout>

3 个答案:

答案 0 :(得分:0)

设置TextView的冻结Text =“true”属性..

答案 1 :(得分:0)

<LinearLayout
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
        xmlns:android="http://schemas.android.com/apk/res/android">

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"

            >
            <Button
                android:layout_width="wrap_content"
                android:text="1973"
                android:textColor="#ffffff"
                android:layout_marginTop="7dip"
                android:background="#ffff" android:layout_height="wrap_content"/>
            <TextView
                    android:layout_width="wrap_content"
                    android:layout_marginLeft="5dip" android:text="Tony Collier, a cook at the Grandview Foundation in Pasadena, begins collecting and distributing food. Collier receives more food donations from local businesses than anticipated and he shares the food with other organizations helping the hungry.  Collier begins the first search for a larger facility by moving the small operation into a two-car garage." android:textSize="12dip" android:layout_height="wrap_content"/>

        </LinearLayout>     

</LinearLayout>

检查

我尝试了你需要的只是简单的

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent">
    <LinearLayout android:id="@+id/LinearLayout01" android:layout_height="match_parent" android:orientation="horizontal" android:layout_width="fill_parent">
        <Button android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#ffff" android:background="@drawable/icon" android:text="1222"></Button>
        <TextView android:id="@+id/TextView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Text  Tony Collier, a cook at the Grandview Foundation in Pasadena, begins collecting and distributing food. Collier receives more food donations from local businesses than anticipated and he shares the food with other organizations helping the hungry.  Collier begins the first search for a larger facility by moving the small operation into a two-car garage."></TextView>
    </LinearLayout>
</LinearLayout>

答案 2 :(得分:0)

您必须为TextView设置一些属性。

实施例
layout_width
MAXLINES
的minlines

请参阅http://developer.android.com/reference/android/widget/TextView.html