What is the difference between match_parent and fill_parent?

后端 未结 17 1973
离开以前
离开以前 2020-11-22 07:37

I\'m a little confused about two XML properties: match_parent and fill_parent. It seems that both are the same. Is there any difference between the

17条回答
  •  借酒劲吻你
    2020-11-22 08:24

    They're the same thing (in API Level 8+). Use 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)

    ...

    fill_parent: 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.

    http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html

提交回复
热议问题