0

Androidで画像を正しくスケーリングする方法がわかりません。640*125 ピクセルの iPhone アプリの画像があります。これを Android アプリで使用する必要がありますが、正しくスケーリングする方法がわかりません。

下の画像では、ScaleType として 'FitEnd' を使用しています。これは、本来あるべきサイズの約 2 倍の高さを除けば問題ないように見えます (グレーの図の最も高い部分と同じ高さにする必要があります)。

これを修正するにはどうすればよいですか?

選択すると、スケーリングする必要がある画像が表示されます

編集:.xmlを含む

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/main"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <ViewFlipper
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_above="@+id/buttonrow" >

            <ViewFlipper
                android:id="@+id/flipper"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent" >

                <include
                    android:id="@+id/first"
                    layout="@layout/activity_events" />
                <include
                    android:id="@+id/second"
                    layout="@layout/event_detail" />
            </ViewFlipper>  
            <include
                android:id="@+id/second"
                layout="@layout/event_detail" />
        </ViewFlipper>

        <RelativeLayout
            android:id="@+id/buttonrow"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true" >

            <ImageView
                android:id="@+id/imageView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:scaleType="fitEnd"
                android:src="@drawable/bottombar" />


        </RelativeLayout>

    </RelativeLayout>
4

1 に答える 1

0

私は2つのバージョンを持っています:

  1. 画像の背景は透明ではありません。画像パラメータは大丈夫です、問題はあなたの写真にあります

  2. 最初のバージョンでない場合は、.xml ファイルを見せてください

于 2013-02-04T14:15:52.047 に答える