Tôi đang cố sử dụng SlidingPaneLayout. Khung nhìn bên trái là một ListFragment và khung nhìn bên phải là một khung nhìn chi tiết. Bố trí được hiển thị chính xác và tôi có thể trượt nó. Nhưng nếu xem chi tiết ở phía trước danh sách và tôi nhấp vào nó, danh sách trong nền sẽ nhận được nhấp chuột.Nhấp vào sự kiện trên SlidingPaneLayout
bố trí của tôi trông như thế này:
<?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>
tôi sử dụng mã này cho việc thiết lập người nghe nhấp chuột trong ListFragment
@Override
public void onListItemClick(ListView list, View view, int position, long id) {
iItemClickListener.onListFragmentItemClick(view, position);
}
Làm thế nào tôi có thể giải quyết này?
Chỉ cần thêm thông tin thêm một chút, android: clickable = "true" cần được thêm vào bố cục của đoạn thứ hai, chứ không phải (như tôi nghĩ ban đầu) vào nút của đoạn thứ hai vào bố cục chính – fedepaol