开发者

Problem in Display TextView

I have Done One Layout in My Application Where i have TextView and开发者_如何转开发 in that i have to shown the Paragraph. now i9 have set all the contain in to the XML file as below code. But it cant seen the Whole text and the last line of the paragraph is cut. . . What i have to do for it ?? Help me. . . Thanks. Code:

<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>


<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>

Check this

i tried what you needed its just simple

<?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>


You have to set some attributes for your TextView.

Ex.
layout_width
maxLines
minLines

Please refer to http://developer.android.com/reference/android/widget/TextView.html.


set Freezes Text="true" property of TextView..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜