0

TextView非常に長いテキストがあります。グラフィックレイアウトでは、細かく折り返されたテキストが表示されますが、これを実行すると、テキストは折り返されません。これが私のデザインコードです。

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="15dp"
    android:layout_marginLeft="5dp"
    android:background="#ffffff" >

    <RelativeLayout
        android:id="@+id/layout_title"
        style="@style/dialog_header" >

        <ImageView
            android:id="@+id/image_title"
            style="@style/dialog_header_image"
            android:contentDescription="@string/update_reply"
            android:src="@drawable/compose" />

        <TextView
            android:id="@+id/txt_title"
            style="@style/dialog_header_title"
            android:layout_toRightOf="@+id/image_title" />
    </RelativeLayout>

    <ScrollView
        android:id="@+id/layout_message"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/layout_title"
        android:fadingEdge="none"
        android:fillViewport="true" >

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

            android:padding="10dp" >

            <TextView
                android:id="@+id/txt_message"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:minHeight="130dp"
                android:text="Don&apos;t work too hard to give yourself the best of everything, instead make a greater effort to give God the best of yourself." />
        </LinearLayout>
    </ScrollView>

    <LinearLayout
        android:id="@+id/button_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/layout_message" >

        <Button
            android:id="@+id/btn_reply"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/reply" />

        <Button
            android:id="@+id/btn_forward"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/forward" />
    </LinearLayout>
</RelativeLayout>

ここに画像の説明を入力してください

これを表示したいのですが、1行しか表示されません

4

3 に答える 3

0

これを削除します

android:minHeight="130dp"

そして、textviewの高さの値を変更します

android:layout_height="XXXdp"
于 2012-12-08T11:06:13.683 に答える
0

これを試して

android:text="Don&apos;t work too hard to give yourself the\n best of everything, instead     make a greater\n effort to give God the best of yourself."
于 2012-12-08T11:06:42.433 に答える
0

テキストの折り返しを取得するには、 で設定android:singleLine=falseTextViewます。

http://developer.android.com/reference/android/widget/TextView.html#attr_android:singleLine

于 2012-12-08T11:11:10.300 に答える