画像のサイズをスマホごとにあわせたいのですが、方法はございますか?
以下のXMLでは、Nexus6では私の思う通りの大きさになるのですが、それ以外だと大きくなったり小さくなったりしてレイアウトが崩れてしまいます。
XML
1<?xml version="1.0" encoding="utf-8"?> 2<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 xmlns:app="http://schemas.android.com/apk/res-auto" 4 android:layout_width="match_parent" android:layout_height="match_parent" 5 > 6 7 <ImageView 8 android:id="@+id/imageView3" 9 android:layout_width="200dp" 10 android:layout_height="200dp" 11 android:layout_alignParentEnd="true" 12 android:layout_alignParentTop="true" 13 android:layout_marginTop="194dp" 14 android:scaleType="fitCenter" 15 android:src="@drawable/gu" /> 16 17 <ImageView 18 android:id="@+id/imageView4" 19 android:layout_width="200dp" 20 android:layout_height="200dp" 21 android:layout_alignParentStart="true" 22 android:layout_alignTop="@+id/imageView3" 23 android:scaleType="fitCenter" 24 android:src="@drawable/gu" /> 25 26 <TextView 27 android:id="@+id/textView6" 28 android:layout_width="wrap_content" 29 android:layout_height="wrap_content" 30 android:layout_alignParentTop="true" 31 android:layout_centerHorizontal="true" 32 android:layout_marginTop="68dp" 33 android:text="じゃんけん・・・" 34 android:textSize="40sp" 35 android:textStyle="bold" /> 36</RelativeLayout>
「android 開発 画像 あわせる」と検索してもそれらしきことが見つからなかったため、お知恵をお貸しください。
宜しくお願い致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。