我正在尝试制作一个图像应用程序,并且我的一个 xml 文件中有一个按钮和图像视图。我在图像视图上有一张默认图片。在某些设备上,它太小或太大。我不希望图片超出屏幕或按钮。我该怎么做?这是xml代码
<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" >
<Button
android:id="@+id/btakePic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:text="Take Picture" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="400dp"
android:gravity="center"
android:src="@drawable/android_syh" />
</RelativeLayout>