snail Android 第三方架包
来源:互联网 发布:java动态表单 组件 编辑:程序博客网 时间:2024/06/06 03:48
snail
项目地址:thesnail/snail
简介:https://github.com/thesnail/snail
更多:作者 提 Bug 示例 APK
标签:
百分比布局-注解-Android 第三方架包功能:
百分比库:比 Android 中权重更加好用注解配置:优化 findViewById、setContentView、onClick 使 APK 变得更小注解使用: 在 Activity 中的 onCreate()使用 ViewInjectUtils.inject(this);或者定义一个 BaseActivity 其他的 Activity 继承他在 BaseActivity 的 onCreate()中使用 ViewInjectUtils.inject(this); 在类上面 @ContentView(R.layout.activity_main) 表示引入布局 和 onCreate 中 setContentView(R.layout.activity_main)一样 在声明的控件上面 @ViewInject(R.id.txt1) 和 findViewById(R.id.txt1);一样 在某个 onClick(View v)方法上面 @OnClick({R.id.txt1,R.id.txt2,...})表示注册监听事件百分比库使用方法 在头部添加 xmlns:app="http://schemas.android.com/apk/res-auto" 其中 app 名称可以自定义 新增属性: layout_widthPercent 控件的长度占父容器的百分比 例如 app:layout_widthPercent="50%" 控件占父容器的百分之 50 layout_heightPercent 控件的高度占父容器的百分比 layout_marginPercent layout_marginTopPercent layout_marginBottomPercent layout_marginLeftPercent layout_marginRightPercent layout_marginStartPercent layout_marginEndPercent layout_textSizePercent 文字大小所占的百分比 layout_maxWidthPercent layout_maxHeightPercent layout_minWidthPercent layout_minHeightPercent layout_paddingPercent layout_paddingTopPercent layout_paddingBottomPercent layout_paddingLeftPercent layout_paddingRightPercent 以上也不在逐个介绍 和以前的使用差不多只是在后面加上了 Percent 就表示所占的百分比 注意:这些属性所占的百分比是相对于父容器而言 如果在%后面跟上 h 和 w 表示 h 表示所占父容器高的百分比 w 表示所占父容器的长度百分比
阅读全文
0 0
- snail Android 第三方架包
- snail
- Android第三方架包.jar
- [project] snail
- The Snail
- The Snail
- The Snail
- Snail Trails
- The Snail
- The Snail
- The Snail
- The Snail
- hdu1302The Snail
- 1302 Snail
- hdoj1032The Snail
- hdu1302The Snail
- The Snail
- The snail
- 单点登录原理与简单实现
- CSS实现背景透明,文字不透明(兼容各浏览器)
- 朴素 多项式期望求解
- RXAndroid2.0初学习四
- Dubbo与Zookeeper、SpringMVC整合和使用
- snail Android 第三方架包
- C#-using的另一种用法
- 算法系列-bitmap算法详解和实现
- mtk和高通是如何把自己的内容打包到系统镜像中的
- ubuntu-kylin 16.04 LTS +VM12pro+py2.7+tensorflow0.8.0+mnist
- 51nod 1182 完美字符串
- 关于游戏架构设计的一些整理吧
- HashMap和Hashtable的区别
- 七夕手势识别小程序,献给爱人