Question

In my activity designed for use on tablets I call setContentView on a LinearLayout defined in XML that contains references to a few different fragments. Each fragment reference in the LinearLayout has its width set to 0dp and has a weight specified.

These fragments also use LinearLayouts for their views. In the XML for those, I set the background as a nine-patch image.

What happens when I run the app is that portions of the nine-patch literally come and go randomly and it's driving me crazy! The fragment on the left contains a WebView and a ScrollView, and the fragment on the right contains a WebView and a ViewPager. Sometimes when the activity loads everything is drawn correctly, but other times there will be no background on the right fragment. Sometimes half of the background is drawn for the right fragment, and then when I interact with the left fragment, it may disappear and reappear!

I've spent a lot of time trying to figure out what is happening and if I am doing something wrong. Has anyone else ever seen this or corrected it?

Thank you!

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top