0

![ここに画像の説明を入力してください][1]私はこの問題に夢中になるでしょう。画像のアスペクト比を修正できません。重力とマトリックスを試してみましたが、アスペクト比が維持されていません。どうすれば解決できますか?(配列からの)textviewに可変テキストがあり、固定画像が欲しいのですが。

<?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"
 android:background="#000000"
 android:orientation="vertical" >

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

<ImageView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/luna1"
    android:textSize="15pt" 
    android:layout_weight="1"/>

<ScrollView
    android:id="@+id/scrollView10"
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:layout_gravity="center"
    android:background="#000000"
    android:layout_weight="1" >

    <TextView
        android:id="@+id/textView10"
        android:layout_width="match_parent"
        android:layout_height="320dp"
        android:background="#000000"
        android:gravity="center"
        android:textColor="#ffffff"
        android:textSize="14sp"
               android:text="jjkjkljkjkldjklsdfjkljklsdfjklsdfjklsdfjklsdfjklsdfjklsdfjklfjlsdfjkl"
        android:autoLink="web|email"
        android:textStyle="italic" />
</ScrollView>
</LinearLayout>

<Button
android:id="@+id/button10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Chiudi" />

</LinearLayout>
4

1 に答える 1

1

あなたが探してscaleTypeいる。scaleTypeをまたはのようなものにcenterCrop設定するcenterInsideと、アスペクト比が維持されます。

更新

またsrc、ではなく、画像の設定に使用していることを確認してくださいbackground

于 2013-01-17T18:49:23.350 に答える