質問

I am trying to use SlidingPaneLayout , I am having this weird behavior that i can slide the left panel as well which is the ListView , I thought it is something wrong in my code but turned out that even the API demos have the same issue. This issue occurs on phone but not on tablets.

Any ideas ?

Edit: I have S4 and when running the API Demos on it it works with no issues, and I have S1 the demos having the issue above. In my implementation I am using two FrameLayout that I place Fragment in.

役に立ちましたか?

解決

I figured the issue out , I have set the width of the left pane which contains the list to a width greater than the available width, and that was causing the issue, setting a smaller width fixed my issue.

他のヒント

This is a default behaviour of the SlidingPaneLayout, when you swipe from the extreme left of your screen towards the middle. Check out the Hangouts app as the example.

It's designed that the layout will try and show up as much of the views a it can. So for example when on landscape on the Nexus 7 and greater it will show the conversations and the detail view at the same time. At this point the swipe left-to-right wouldn't make sense. But when you move down to a smaller screen device such as a portait Nexus 7 or phone then the conversation pane is obscured. As a result at that point you want to be able to swipe the detail pane out of the way from the conversation view.

This Big Nerd Ranch post has more details.

Take a look at this question for an approach to disable it.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top