What is the difference between match_parent and fill_parent?

后端 未结 17 1983
离开以前
离开以前 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:18

    Google changed the name to avoid confusion.

    Problem with the old name fill parent was that it implies its affecting the dimensions of the parent, while match parent better describes the resulting behavior - match the dimension with the parent.

    Both constants resolve to -1 in the end, and so result in the identical behavior in the app. Ironically enough, this name change made to clarify things seems to have added confusion rather than eliminating it.

提交回复
热议问题