What is the difference between match_parent and fill_parent?

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

    Functionally no difference, Google just changed the name from fill_parent to match_parent, from API level 8 (Android 2.2). FILL_PARENT is still available for compatibility reason.

    LayoutParams.FILL_PARENT and LayoutParams.MATCH_PARENT both have value -1. Not sure what tempted google to change from Fill Parent to Match Parent :)

    Since most of the phones are >= Android 2.2 .. you should use Match Parent for future compatibility... not sure when they will discontinue the older Fill Parent constant!

提交回复
热议问题