你真的知道drawable和mipmap的区别吗
2019-06-18 16:59
246 查看
版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/codehxy/article/details/92796125
你真的知道drawable和mipmap的区别吗?
代码一:图片放在mipmap下
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/main_image"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerVertical="true" android:orientation="vertical"> <LinearLayout android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="center_horizontal" android:layout_weight="1" android:orientation="horizontal"> <ImageView android:id="@+id/galery" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@mipmap/gallery_66" /> <ImageView android:id="@+id/camera" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:src="@mipmap/camera_56" /> </LinearLayout> <ImageView android:id="@+id/editedImages" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_weight="1" android:src="@mipmap/mag" /> </LinearLayout> </RelativeLayout>
代码一对应效果如下
代码二:图片放在drawable下
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/main_image"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerVertical="true" android:orientation="vertical"> <LinearLayout android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="center_horizontal" android:layout_weight="1" android:orientation="horizontal"> <ImageView android:id="@+id/select_ablum" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/gallery_66" /> <ImageView android:id="@+id/take_photo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:src="@drawable/camera_56" /> </LinearLayout> <ImageView android:id="@+id/edit_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_weight="1" android:src="@drawable/mag" /> </LinearLayout> </RelativeLayout>
代码二对应效果如下
相关文章推荐
- drawable与mipmap的区别(android资源文件放置位置)
- mipmap 目录和drawable 目录有什么区别
- mipmap目录和drawable目录的区别
- Android Studio Drawable和Mipmap文件夹的区别
- Android mipmap 和 drawable 文件夹的区别
- mipmap 和 drawable 的区别
- android studio mipmap 目录和 drawable 目录有什么区别
- 安卓中drawable和mipmap的区别
- mipmap 和 drawable 的区别
- Android mipmap文件夹和drawable文件夹的区别
- mipmap 和 drawable 的区别
- Android Studio中mipmap目录和drawable目录有什么区别
- mipmap 目录和drawable 目录有什么区别
- Android mipmap和drawable的区别
- Android中的图片(drawable目录;drawable和mipmap的区别)
- mipmap和drawable的区别
- 定义动画的xml文件区别及drawable目录和mipmap目录存放图片资源的类型
- 114、drawable和mipmap 目录下图片的区别
- mipmap和drawable文件夹的区别
- mipmap 和 drawable 区别与误区