0

私のレイアウトはとてもシンプルです。2 つのテキストビュー (見出しとテキスト) の上にイメージビューを含む垂直相対レイアウトを使用します。ポートレイトでは、それはうまく見えます。ただし、ランドスケープでは、イメージビューが画面の幅全体を埋めませんが、下のテキストはまだ埋められます。それはよく見えません。上記のイメージビューと同じ幅のテキスト幅を作成できる簡単な方法はありますか?

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout 
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
     >

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:scaleType="fitStart"
    android:adjustViewBounds="true"
    android:src="@drawable/picture" />

<TextView
    style="@style/DescriptionTitle"
    android:id="@+id/textView1"
    android:layout_alignLeft="@id/imageView1"
    android:layout_below="@id/imageView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/heading"   />

<TextView
    style="@style/DescriptionText"
    android:id="@+id/textView2"
    android:layout_alignLeft="@id/imageView1"
    android:layout_below="@id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/text"   />

</RelativeLayout>
</ScrollView>
4

2 に答える 2

0



android:src="@drawable/picture"
使用する代わりに、
android:background="@drawable/picture"それがあなたのために働くことを願っています

于 2013-05-17T19:59:57.003 に答える