gpt4 book ai didi

android - SlidingPaneLayout 上的点击事件

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:09:21 29 4
gpt4 key购买 nike

我正在尝试使用 SlidingPaneLayout。左 View 是 ListFragment,右 View 是详细 View 。布局显示正确,我可以滑动它。但是如果详细 View 在列表前面并且我点击它,后台的列表会收到点击。

我的布局是这样的:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SlidingPaneLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/sliding_pane_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<fragment android:name="net.name.multiremote.RemoteListFragement"
android:id="@+id/fragment_remote_list"
android:layout_width="580dp"
android:layout_height="match_parent"
android:layout_gravity="left" />

<fragment
android:id="@+id/fragment_remote"
android:name="net.name.multiremote.RemoteFragment"
android:layout_width="850dp"
android:layout_height="match_parent"
android:layout_weight="1" />

</android.support.v4.widget.SlidingPaneLayout>

我使用这段代码在 ListFragment 中设置点击监听器

@Override
public void onListItemClick(ListView list, View view, int position, long id) {
iItemClickListener.onListFragmentItemClick(view, position);
}

我该如何解决这个问题?

最佳答案

只需将 android:clickable="true" 添加到 SlidingPaneLayout 中的第二个 FragmentFrameLayout 即可。

关于android - SlidingPaneLayout 上的点击事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18181749/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com