문제

(preface: I have this problem while using the v4 Android support library)

I'm using the new SlidingPaneLayout to show an Android V2 map behind a List View, like this

----[¨¨¨¨]
| M [  L ]
| A [  I ]
| P [  S ]
|   [  T ]
----[____]

It has two states

  1. Open: the map takes up approx. 85% of the screen, with the list peeking in from the right screen edge.
  2. Closed: reverse of the above; with the list using approx. 85% of the screen and the map peeking in from the left screen edge.

I'm having a problem where the List View is drawn behind the map when pulling it out ("closing the pane" in SlidingPaneLayout terminology). The List View interaction is normal, but the map part of the screen does not get painted over with the list.

There's also the problem of the shadow (set with setShadowDrawable() or setShadowResource()) not being drawn at all when the list is out (pane closed).

  • I can get the screen to redraw correctly by going into a new Activity and then back again.
  • I only get this problem when I update the Map and List View with new content while the Map is showing ("pane open" in SlidingPaneLayout terminology).
도움이 되었습니까?

해결책

I can give an answer to my own question, just to document this issue.

If I put a transparent view above the SlidingPaneLayout everything will be drawn correctly, dropshadow on the overlying pane and all.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top