android learn Layout_what in XML
来源:互联网 发布:虾囧笑话源码 编辑:程序博客网 时间:2024/06/05 17:19
Layout有两种方式:在XML里声明接口元素、写在代码在运行时形成。既然这两种方式都可以实现一个Layout,那么其中必然存在着某种关系。
google的developer官网上介绍Layout部分有这样一段话:
*In general, the XML vocabulary for declaring UI elements closely follows the structure and naming of the classes and methods, where element names correspond to class names and attribute names correspond to methods. In fact, the correspondence is often so direct that you can guess what XML attribute corresponds to a class method, or guess what class corresponds to a given XML element. However, note that not all vocabulary is identical. In some cases, there are slight naming differences. For example, the EditText element has a text attribute that corresponds to EditText.setText().**
通常情况下,声明接口元素的XML元素表紧密地继承了类和方法的结构与命名,元素的名字和类的名字对应,属性的名字与方法的名字对应。事实上,这种直接的对应关系可以让你根据XML属性猜出方法,也可以根据XML元素猜出类。但是,有一点需要明白,不是所有的元素表都是唯一的。在一些情况下,存在一些轻微的命名区别。例如,元素EditText有一个text属性,对应了EditText.setText()。
因此,在XML中的每个元素,必然存在着一个与它对应的类;属于该元素的属性,在该类中必然存在对应的方法。并且,这种对应允许它们的名字有差别。
- android learn Layout_what in XML
- Learn XML In a Weekend
- xml namespace in android
- Learn To Save and Load External Images in Google Android
- Learn Spring in spring
- learn in oc
- Learn in FCC(2)
- Learn in FCC(3)
- Learn in FCC(4)
- Learn in FCC(5)
- learn plantuml in Windows
- Android: html in strings.xml
- Android drawable in xml study
- Learn Spring in spring(一)
- Learn Spring in spring(二)
- Learn Spring in spring(三)
- Learn Spring in spring(2)
- Learn Spring in spring(3)
- 转:笔记本电脑开机密码忘记的解决方法
- 字符设备驱动----LED驱动程序
- 反射型xss偷取cookie(本地验证)
- 第一次创建技术博客
- Mac OS X El Captain上安装MySQLdb
- android learn Layout_what in XML
- 改进的table单元格拖拽,可限制能拖动的连续单元格范围
- OpenCV中读取视频帧像素值的一般方法
- 构造和解析Json数据
- Normalization Methods
- android调试时apk可运行,导出签名的apk后, 有些功能闪退,
- html中ul元素水平排列问题
- 下一个风口:机器人--工业/农业4.0(李泽湘演讲笔记)
- java设计模式—工厂模式