Jeffrey Cameron Well-Known Member Licensed User Longtime User Aug 2, 2013 #1 I've been having a problem with buttons using a StateList not redrawing correctly. In this example program I have a main layout with two panels (each panel gets its own layout loaded to it). Upon initial display, everything is rendered correctly: . I hide panel 1 and show panel 2 and panel 2 looks fine. I then press the button to go back to panel 1 (hide 2 and show 1) and panel 1 now renders incorrectly: After this, switching between panels will cause varying combinations of incorrectly drawn buttons. Is this a bug, or have I overlooked something in the StateListDrawable creation/implementation? Thanks in advance, Richard Attachments StatelistTest.zip StatelistTest.zip 190.1 KB · Views: 593
I've been having a problem with buttons using a StateList not redrawing correctly. In this example program I have a main layout with two panels (each panel gets its own layout loaded to it). Upon initial display, everything is rendered correctly: . I hide panel 1 and show panel 2 and panel 2 looks fine. I then press the button to go back to panel 1 (hide 2 and show 1) and panel 1 now renders incorrectly: After this, switching between panels will cause varying combinations of incorrectly drawn buttons. Is this a bug, or have I overlooked something in the StateListDrawable creation/implementation? Thanks in advance, Richard
klaus Expert Licensed User Longtime User Aug 2, 2013 #2 You must dim and initialize new drawables for each button to make them independent ! Attached a modified version. Best regards. Attachments StatelistTest1.zip StatelistTest1.zip 190.1 KB · Views: 712
You must dim and initialize new drawables for each button to make them independent ! Attached a modified version. Best regards.
Jeffrey Cameron Well-Known Member Licensed User Longtime User Aug 2, 2013 #3 klaus said: You must dim and initialize new drawables for each button to make them independent ! Attached a modified version. Best regards. Click to expand... I was unaware... Thanks for the quick reply! ---- Richard
klaus said: You must dim and initialize new drawables for each button to make them independent ! Attached a modified version. Best regards. Click to expand... I was unaware... Thanks for the quick reply! ---- Richard