开发者_运维问答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.
精彩评论