这里是完整的xml文件,但它们没有同等缩放
我的意思是说两个图像的宽度和高度分别为500像素,但如果屏幕分辨率为700像素,它们的平均分辨率不会达到350像素,我想实现它
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".Pokemon"
android:background="@drawable/pokemon_monstermmorpg_bg_land">>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:src="@drawable/application_text"
android:adjustViewBounds="true"
android:layout_centerInParent="true"
android:scaleType="centerInside"
/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageButton_register"
android:background="@null"
android:src="@drawable/image_button"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:layout_below="@id/imageView"
android:layout_centerInParent="true"
/>
答案 0 :(得分:1)
将您的imageview和图片按钮放在RelativeLayout
中,并将ImageButton
的宽度设置为match_parent
,并将BackGround
的{{1}}更改为ImageButton
来自drawable
答案 1 :(得分:0)
你可以使用权重和。