android meaning of @null in xml attribute

后端 未结 2 1394
北荒
北荒 2021-01-31 06:49

I found the following attribute in one xml layout:

android:background=\"@null\"

What is the meaning of @null? What is the differen

2条回答
  •  心在旅途
    2021-01-31 07:36

    If I remember correctly, omitting the background attribute sets a default background. However, explicitly setting background to "@null" removes the background, causing whatever is below the element to be shown. In particular, if you for instance set the background of a Button to null, the border of the button will also be gone (and the button effectively will not really look like a button at all).

提交回复
热议问题