Skip to content Skip to sidebar Skip to footer

Strange Xml Layout Bug When Targeting Android 4.3

I'm experiencing a really peculiar bug with an XML layout file when building my application while targeting API level 18. It doesn't happen with API level 17. I'm running the appli

Solution 1:

I managed to solve the issue myself.

Like I said, I am using the StickyGridHeaders library and referencing it in my application. It appears that the library was targeting API level 17. I changed it to level 18, compiled and ran the application - great success!

In conclusion: Make sure your application and libraries target the same API level.

Solution 2:

I have the same issue, too. My experiences have shown that crossed alignments are the reason of the problem (TextView @+id/seasonTitle has the property android:layout_toLeftOf="@+id/episodeCount"; TextView @+id/episodeCount has the properties android:layout_alignBottom="@+id/seasonTitle" and layout_alignTop="@+id/seasonTitle". One of the Layouts won't refresh its childs correct. Changing the Layout-XML that crossed alignments are prevented, you no longer have this problem.

Solution 3:

I have the same issue :

  • a ListView with a white background
  • each child has a View with a gray background and width and height to match_parent, within a RelativeLayout

on API 17, every is OK on API 18+, the ListView is white

instead of setting a fixed height, I put a min_height to the View, and the problem is (temporary) solved!

hope it helps

Post a Comment for "Strange Xml Layout Bug When Targeting Android 4.3"