Android 百分比布局库的使用
来源:互联网 发布:酒店软件系统排名 编辑:程序博客网 时间:2024/06/05 12:40
1.布局中preview报错问题:
解决办法:
在preview界面,切换一下sdk的版本,选择特定的版本,比如23的,不要仅仅选择automaticly pick best
2.使用方法:
如下图所示:
<TextView android:id="@+id/tv_1" android:layout_width="0dp" android:layout_height="0dp" android:layout_alignParentBottom="true" app:layout_marginBottomPercent="70%" android:background="@drawable/bar_chart_mark" android:ellipsize="end" android:gravity="center" android:singleLine="true" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="@android:color/white" android:textSize="8sp" app:layout_heightPercent="10%" app:layout_widthPercent="70%" />
有点类似LineLayout的weight方法,width和height相应为0,然后使用一个比重,其中要注意的是,使用的是
app的命名空间,而不是android:
app:layout_heightPercent="10%"app:layout_widthPercent="70%"
app:layout_marginBottomPercent="70%"
感覺这个库不足的地方就是没有代码提示功能,代码不能智能提示,需要自己完整输入.
在布局中,只需要调整各值得百分比就可以了…
3.举个栗子:~github
sample
0 0
- Android 百分比布局库的使用
- Android百分比布局的使用
- android 百分比布局percentFrameLayout,percentRelativeLayout的使用
- Android 百分比布局支持库使用
- 百分比布局的使用
- 百分比布局的使用
- 百分比布局的使用
- Android 百分比布局库
- Android百分比布局库
- Android Support库百分比布局
- Android百分比布局支持库
- android Percent百分比布局库
- Android 百分比布局库(percent-support-lib) 使用详解
- Android百分比布局使用小坑一个
- android PercentFrameLyout 百分比布局 使用及注意事项
- Android百分比布局的解析与扩展
- Android中实现百分比布局的方式
- 安卓百分比布局的使用
- 精通C++资源管理-以对象管理资源
- Android事件分发
- C++ pair(对组)用法
- Tomcat 发布目录
- 搭建一个简单的springMVC框架
- Android 百分比布局库的使用
- 109. Convert Sorted List to Binary Search Tree
- C++语言语法你应该知道的(基础篇)
- Hadoop 2.0工作原理学习
- Error:Execution failed for task ':app:processDebugResources'.解决
- ajax、反向ajax、jsonp详解
- Strlen在实际使用中的一点体会
- 隐藏状态栏
- Nightmare Ⅱ