我是靠谱客的博主 甜蜜巨人,这篇文章主要介绍android 边距 百分比,Android百分比布局:PercentRelativeLayout,现在分享给大家,希望可以做个参考。



Android百分比布局:PercentRelativeLayout

在最新的Android support包中,增加了开发者期待的百分比布局PercentRelativeLayout和PercentFrameLayout,不过,Android官方是以support包的支持形式出现。使用百分比布局前,需要先导入在support支持包目录下名为“percent”的库,如图所示:

9919b6e1c0d868f750a409dd1cdaf69b.png

将percent导入到Eclipse作为一个lib,然后就可以使用百分比布局PercentRelativeLayout和PercentFrameLayout。

本文以PercentRelativeLayout为例加以说明。

PercentRelativeLayout在RelativeLayout增加了一些针对百分比布局的必要属性如:

layout_widthPercent 、 layout_heightPercent

layout_marginPercent

layout_marginLeftPercent

layout_marginTopPercent

layout_marginRightPercent

layout_marginBottomPercent

layout_marginStartPercent

layout_marginEndPercent

其中比较重要的是layout_widthPercent

最后

以上就是甜蜜巨人最近收集整理的关于android 边距 百分比,Android百分比布局:PercentRelativeLayout的全部内容,更多相关android内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(45)

评论列表共有 0 条评论

立即
投稿
返回
顶部