显示 TextView 的问题

发布于 2024-11-02 18:43:33 字数 1536 浏览 1 评论 0原文

我在我的应用程序中完成了一种布局,其中我有 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>

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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

哭泣的笑容 2024-11-09 18:43:33
<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>
<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>
Spring初心 2024-11-09 18:43:33

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

例如
布局宽度
最大行数
minLines

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

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.

无人问我粥可暖 2024-11-09 18:43:33

设置 TextView 的 Freezes Text="true" 属性..

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文