开发者

android meaning of @null in xml attribute

I found the following attribute in one xml layout:

android:background="@null"

What is the meaning of @null? What is the difference between specifying backgroun开发者_如何学编程d="@null" and omitting background attribute?


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).


What i have observed if i do android:background="@null"or android:background="@android:color/transparent" both have same effect, they just remove the background of the view, so you will see the background colour of the view which is beneath this view.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜