2012-01-06 6 views
0

xmlファイルには9個のイメージ、つまり..、3行、各行に3つのイメージが含まれています。ポートレートビューでは画像が非常にうまく表示されますが、横長ビューでは最初の2行の画像がうまく表示され、最後の行画像は小さな画像として圧縮されます。私のxmlファイルには、あなたは、私が事前に間違った... おかげでやっていることを教えてくださいすることができ画像圧縮を横長表示で解決する方法は?

<?xml version="1.0" encoding="UTF-8"?> 
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@+id/relativeLayout1" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:background="@drawable/back" > 

     <ImageView 
      android:id="@+id/imageView1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentTop="true" 
      android:layout_marginLeft="16dp" 
      android:layout_marginTop="30dp" 
      android:src="@drawable/fire_icon" /> 

     <ImageView 
      android:id="@+id/imageView2" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignTop="@+id/imageView1" 
      android:layout_centerHorizontal="true" 
      android:src="@drawable/fire_icon" /> 

     <ImageView 
      android:id="@+id/imageView3" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentRight="true" 
      android:layout_alignTop="@+id/imageView2" 
      android:layout_marginRight="24dp" 
      android:src="@drawable/fire_icon" /> 

     <ImageView 
      android:id="@+id/imageView4" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignLeft="@+id/imageView1" 
      android:layout_below="@+id/imageView1" 
      android:layout_marginTop="25dp" 
      android:src="@drawable/fire_icon" /> 

     <ImageView 
      android:id="@+id/imageView5" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignLeft="@+id/imageView2" 
      android:layout_alignTop="@+id/imageView4" 
      android:src="@drawable/fire_icon" /> 

     <ImageView 
      android:id="@+id/imageView6" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignLeft="@+id/imageView3" 
      android:layout_alignTop="@+id/imageView5" 
      android:src="@drawable/fire_icon" /> 

     <ImageView 
      android:id="@+id/imageView7" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignLeft="@+id/imageView4" 
      android:layout_below="@+id/imageView4" 
      android:layout_marginTop="25dp" 
      android:src="@drawable/fire_icon" /> 

     <ImageView 
      android:id="@+id/imageView8" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignLeft="@+id/imageView5" 
      android:layout_alignTop="@+id/imageView7" 
      android:src="@drawable/fire_icon" /> 

     <ImageView 
      android:id="@+id/imageView9" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignRight="@+id/imageView6" 
      android:layout_alignTop="@+id/imageView8" 
      android:src="@drawable/fire_icon" /> 

    </RelativeLayout> 

を下回っている

+1

gridview ..... –

+0

を使用してください。スクリーンショットを追加できますか? –

+0

まず、画像の品質を確認してから、プログラムでグリッドビューを使用してください。グリッドビューで幅と高さを簡単に指定できます –

答えて

0

デザインに類似lanscapeモードでのレイアウトと「解像度/レイアウトの土地に入れ"両方のレイアウトが同じ名前であることを確認してください。

+0

感謝します – NareshRavva

関連する問題