ImageViewをディスプレイの右下に配置しようとしています。さまざまなサイズのディスプレイでイメージを動的に拡大したいと思います。Android RelativeLayout alignParentRightが正しく整列しないImagview
画像が小さく、拡大するように設定されていないときは画像が正しく整列しますが、fill_parentに設定すると、画像は左側に移動し、表示の右側に並んでいなくなります。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<SurfaceView
android:id="@+id/surface1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
></SurfaceView>
<ImageView
android:src="@+drawable/image_1_patched"
android:layout_height="fill_parent"
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_alignParentRight="true"
></ImageView>
</RelativeLayout>
イメージをできるだけ広い範囲に収め、ディスプレイの右側に揃えるにはどうすればよいですか?
ありがとうございます。
I疲れfitCenterにこれを追加したいかもしれませんが、あなたはその左を期待するかもしれないとして、中央の画像。しかしfitEndは、画像を右と下に並べて整列させました。私を正しい方向に向けてくれてありがとう。 – UnluckyDevil
心配はいりません。間違ったタグをコピーしました。どのように拡大縮小するかに基づいて、複数のオプションがあります。あなたが画像のアスペクト比を気にしないならば、fitXY。 – James