What is the difference between match_parent and fill_parent?

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

    match_parent and fill_parent are same property, used to define width or height of a view in full screen horizontally or vertically.

    These properties are used in android xml files like this.

     android:layout_width="match_parent"
     android:layout_height="fill_parent"
    

    or

     android:layout_width="fill_parent"
     android:layout_height="match_parent"
    

    fill_parent was used in previous versions, but now it has been deprecated and replaced by match_parent. I hope it'll help you.

提交回复
热议问题