aro*_*ero 11
您将不得不创建4个图像.mdpi将是基线,意思mdpi是100%.其他人遵循这个公式:

将每个图像在适当的资源文件夹,drawable-ldpi,drawable-mdpi,drawable-hdpi,drawable-xhdpi.Android会根据当前设备选择合适的drawable.
然后,在您的布局中只是wrap_content您的宽度和高度,不需要指定任何固定大小:
<ImageView
android:src="@drawable/my_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1605 次 |
| 最近记录: |