Click events on SlidingPaneLayout

瘦欲@ 提交于 2019-12-05 12:21:44

Just add android:clickable="true" to the second Fragment or FrameLayout in the SlidingPaneLayout.

Locutus was correct. Whatever the fragment on top, add the property

android:clickable="true"

so it will not pass the click event to the fragment below.

Thanks everyone for saving my time. Here is my code. I have used an overridden layout but this works on regular sliding pane layout as well. look at the 2nd fragment, I've added clickable true property.

<com.ironone.streaming.application.MySlidingPaneLayout
        android:id="@+id/pane"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <FrameLayout
            android:id="@+id/pane1"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

        <FrameLayout
            android:id="@+id/pane2"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:clickable="true" />
    </com.ironone.streaming.application.MySlidingPaneLayout>

I have the same problem, I think it's a combination of "v4" version of Fragment and ListFragment and the SlidingPanelLayout... If you change the import from "v4" to import normal "android.app.ListFragment;" and "import android.app.Fragment;" everything works.

Sorry for my english ;)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!