match_parent

     有網友表示對於很多工程中的MATCH_PARENT出現在layout中感到不明白,過去只有FILL_PARENT和WRAP_CONTENT那麼match_parent到底是什麼類型呢? 其實從Android 2.2開始FILL_PARENT改名爲MATCH_PARENT ,從API Level爲8開始我們可以直接用MATCH_PARENT來代替FILL_PARENT,最後Android123提醒大家,他們的定義本質是一樣均爲-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). 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章