Android tools 命名空间使用

tools命名空间在Android开发中主要用于开发阶段的预览和调试,它允许开发者在XML布局文件中设置一些仅在IDE预览时生效的属性,不参与实际运行时的解析,从而节省资源。常用属性包括预览列表项、文本内容、可见性、图片资源等。通过tools属性,开发者可以更方便地设计和预览UI界面,提高开发效率。
摘要由CSDN通过智能技术生成

什么是tools

tools命名空间是用于在开发阶段,在IDE中预览xml界面用的,真实运行的时候,不会展示tools中设置的属性,在布局资源加载到内存时,不会被解析处理,节约资源,便于开发。

常用的属性均可使用tools命名空间。

常用的属性

//列表预览item布局  对于recyclerView 和listView
tools:listitem="@layout/adapter_folder_list_item"

对于AdapterView 的子类如 ListView, GridView 等, 还支持 tools:listheader 和 tools:listfooter 属性


//列表预览item数量
tools:itemcount="3"
//预览文本内容
tools:text="xxx"
//预览时可见
tools:visibility="visible"
//预览时图片资源
tools:src="@drawable/xxx"
tools:srcCompat="@tools:sample/backgrounds/scenic"
tools:drawableTop="@mipmap/xxx"
//预览时前景
tools:foreground="@color/colorAccent"
//预览时背景
tools:background="#ff0000"
//预览时显示在某个布局中
tools:showIn="@layout/activity_main"
//预览时的上下文
tools:context=".MainActivity"
//预览时的文字大小
tools:textSize="12sp"
//预览时的视图宽度
tools:layout_width="60dp"

README for preparing SD/MMC/Micro-SD CARD for booting Android Pre-Requesites -------------- 1) Need to have an SD/MMC/Micro-SD card with atleast 2GB of size. 2) The script needs to be invoked from ubuntu linux machine 8.04 or above. 3) User needs to have sudo privileges. What script will do ------------------- The mkmmc-android.sh partitions the MMC/SD card into three partiions namely boot, rootfs and data. The script will then put the boot images on boot partition and extracts the android rootfs-rootfs_*.tar.bz2 to rootfs partition. Finally the script will copy the Media clips to the data partition and START_HERE folder to boot partition. How to invoke the script ------------------------ There are three ways of invoking this script. 1) Command: sudo ./mkmmc-android <device> <MLO> <u-boot.bin> <uImage> <boot.scr> <rootfs tar.bz2 > <Media_Clips> <START_HERE Location> Example: sudo ./mkmmc-android /dev/sdc MLO u-boot.bin uImage boot.scr rootfs.tar.bz2 Media_Clips Details: In this case, the script will take Boot Images (MLO,u-boot.bin, uImage and boot.scr) Root Filesystem tarball, Media Clips and START_HERE folder as arguements. The script will then put the boot images on boot partition, extract the android rootfs-rootfs_*.tar.bz2 to rootfs partition. Finally the script will copy the Media clips to the data partition and START_HERE folder to boot partition. 2) Command: sudo ./mkmmc-android <device> <MLO> <u-boot.bin> <uImage> <boot.scr> <rootfs tar.bz2 > Example: sudo ./mkmmc-android /dev/sdc MLO u-boot.bin uImage boot.scr rootfs.tar.bz2 Details: In this case, the script will take Boot Images (MLO,u-boot.bin, uImage and boot.scr) and Root Filesystem tarball as arguements. The script will then put the boot images on boot partition, extract the android rootfs-rootfs_*.tar.bz2 to rootfs partition. The data partiton will be left empty in this case. 3) Command: sudo ./mkmmc-android.sh <device> Example: sudo ./mkmmc-android.sh /dev/sdc Details: In this case, the script will assume default locations for BootImages, Root Filesystem, Media_Clips and START_HERE. This command is equivalent to the following sudo ./mkmmc-android /dev/sdc Boot_Images/MLO Boot_Images/u-boot.bin Boot_Images/uImage Boot_Images/boot.scr Filesystem/rootfs.tar.bz2 Media_Clips START_HERE If you are in a particular Board Specific Directory, extracted from DevKit Release, then you can prepare the sd card by executing sudo ./mkmmc-android.sh <device>, to prepare sd card.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值