安卓应用开发中的布局怎么样才能适应大部分手机? match_parent布局是什么意思? 50
2个回答
展开全部
从Android 2.2开始FILL_PARENT改名为MATCH_PARENT ,从API Level为8开始我们可以直接用MATCH_PARENT来代替FILL_PARENT,他们的定义本质是一样均为-1,只是换了个别名,可能为了更准确些,比如最终在SDK中的定义为:
fill_parent -1 The view should be as big as its parent (minus padding). This constant is deprecated starting from API Level 8 and is replaced by match_parent.
match_parent -1 The view should be as big as its parent (minus padding). Introduced in API Level 8.
wrap_content -2 The view should be only big enough to enclose its content (plus padding).
从Android 2.2开始fill_parent改名为match_parent,从API Level 8可以直接用match_parent来代替fill_parent,不过2.2以后的版本fill_parent仍然可以使用,他们的含义都是一样的,都是填满整个父窗口
三个属性都用来适应视图的水平或垂直大小,一个以视图的内容或尺寸为基础的布局比精确地指定视图范围更加方便。
fill_parent -1 The view should be as big as its parent (minus padding). This constant is deprecated starting from API Level 8 and is replaced by match_parent.
match_parent -1 The view should be as big as its parent (minus padding). Introduced in API Level 8.
wrap_content -2 The view should be only big enough to enclose its content (plus padding).
从Android 2.2开始fill_parent改名为match_parent,从API Level 8可以直接用match_parent来代替fill_parent,不过2.2以后的版本fill_parent仍然可以使用,他们的含义都是一样的,都是填满整个父窗口
三个属性都用来适应视图的水平或垂直大小,一个以视图的内容或尺寸为基础的布局比精确地指定视图范围更加方便。
追问
粘贴。。复制
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询