老師我的layout為什么不能用match_parent,一用就報(bào)錯(cuò)

秋之朝
2014-10-02
1 回答
舉報(bào)
0/150
提交
取消
老師我的layout為什么不能用match_parent,一用就報(bào)錯(cuò)
2014-10-02
舉報(bào)
2014-10-03
版本太低了要2.2才可以用match_parent,你只能用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).
從網(wǎng)上找了些資料貼上面了,看看是不是對你有幫助。