layout布局中的没有match_parent这个参数

从别的工程里拷了几个layout进新的工程中,发现所有的

android:layout_width=”match_parent”

android:layout_height=”match_parent”

都报错,只能改成“fill_parent”,搞了半天想不通,网上搜也没见到;后来查了下help才知道

2.1以下不支持match_parent,只能改成fill_parent了,

2.2及以上才支持match_parent;

 

附文档:

————————————————————————————————————————————–

 

  • FILL_PARENT (renamed MATCH_PARENT in API Level 8 and higher), which means that the view wants to be as big as its parent (minus padding)
  • WRAP_CONTENT, which means that the view wants to be just big enough to enclose its content (plus padding)
  • an exact number

标签