當前位置:編程學習大全網 - 行動軟體 - android開發中layout_width的fill_parent和match_parent有什麽區別

android開發中layout_width的fill_parent和match_parent有什麽區別

妳好:

這個問題網上有很多答案:

過去只有FILL_PARENT和WRAP_CONTENT那麽match_parent到底是什麽類型呢? 其實從Android 2.2開始FILL_PARENT改名為MATCH_PARENT ,從API Level為8開始我們可以直接用MATCH_PARENT來代替FILL_PARENT,最後結論,他們的定義本質是壹樣均為-1,只是換了個別名,可能為了更準確些,比如最終在SDK中的定義為:

(1)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.

(2)match_parent -1 The view should be as big as its parent (minus padding). Introduced in API Level 8.

(3)wrap_content -2 The view should be only big enough to enclose its content (plus padding).

  • 上一篇:急求《絕望主婦》第壹季到第八季中英字幕迅雷下載地址!!!
  • 下一篇:什麽是Isolation
  • copyright 2024編程學習大全網