开发者

Setting background for fragment

开发者_运维问答I have a list fragment and a details fragment in a xml layout which is set as the layout of an activity. How can I set a background image for each fragment. If I am doing it in xml like android:background=@drawable/anyimage it shows an error. I searched but didn't get what I needed, so any suggestions will be appreciated.


In my case the image file was blank and I saved it wrong. Might want to double check.

Edit: Ok, actually, putting android:background in a <fragment> doesn't work, but it will if you put it in the top level element of a layout the fragment inflates.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜