0

I've got a fragment with categories:

enter image description here

When one of the categories is pressed, a list with stories is opened. The fragment of categories is replaced by a fragment with list:

enter image description here

And now is the main part. As a background for listview items I don't use 9-patch resource, because background has difficult texture, that can't be streched, but can be repeated.

I set a divider to null and it's height to 0 (I did it either in code and xml).

mList.setDivider(null);
mList.setDividerHeight(0);

But when I press back button I saw a list with categories for a while in space between list items:

enter image description here

Then I try to do a red background 1 px height and set it to listview:

mList.setDivider(getResources().getDrawable(R.drawable.sep));
mList.setDividerHeight(1);

But got the same result:

enter image description here

I try to use 9-patch resource and there is no such bug. How can I use NOT 9-patch resource (I've already explained a reason higher) and avoid this problem?

nicolausYes
  • 633
  • 8
  • 33
  • 3
    maybe the background you are using have transparent pixels? – Mohsin Naeem Dec 09 '12 at 10:00
  • Are these screen shots from an emulator or device? Is the issue present on both? – Tigger Dec 09 '12 at 10:06
  • @MMohsinNaeem, yes, it was my fault and there was a transperent part in a top of a background 1 px height. And I'll explain why I did this mistake and ask such stupid question. Some time ago I had asked this question, about gradients in listview items backgrounds in Fragments, and there still no answer - http://stackoverflow.com/questions/13780178/listview-items-background-with-gradient-in-fragment And I have to use 9-patch images, as one of the users suggested. But the background is diffiuclt and can't be repeated, so I left and top of the 9-patch background transperent. Need new bg now( – nicolausYes Dec 12 '12 at 23:53

0 Answers0