图像在s3选项卡上显示得很好,但当我在较小的屏幕上尝试时,它提供了类似的图像大小,这使它超出了屏幕。
itemImage = (ImageView) findViewById(R.id.ImageId);请告诉我如何根据屏幕大小管理图像大小。
<ImageView
android:id="@+id/ItemId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:padding="10dp"
android:src="@drawable/img_001" />发布于 2015-04-05 05:42:10
请看一下这些链接,这可能会有帮助
http://developer.android.com/training/multiscreen/screensizes.html
http://developer.android.com/guide/practices/screens_support.html
发布于 2015-04-05 06:34:47
您可以创建多个布局。例如,一个用于小屏幕,另一个用于中屏幕,另一个用于大屏幕。你基本上只需要改变大小,但你也可以为大屏幕做一个双协议布局,让它看起来更漂亮。android自动选择布局。设置此 http://developer.android.com/training/multiscreen/screensizes.htm
对于不同的屏幕密度,使用不同的图像大小也是一种很好的做法。
发布于 2015-04-05 14:46:28
Android不会调整图像的大小。在显示之前,您必须调整图像的大小。
https://stackoverflow.com/questions/29451633
复制相似问题