Navigationsschubladenlayout mit Include-Layout
Ich denke, mein Problem ist eigentlich recht einfach, aber ich kann nicht herausfinden, wie ich es lösen soll. a eine funktionierende Navigationsleiste mit diesem Code haben:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="5dp" >
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/category_list_view"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</ListView>
</FrameLayout>
<!-- The navigation drawer -->
<ListView
android:id="@+id/left_drawer"
android:entries="@array/features"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="left"
android:choiceMode="singleChoice"
android:divider="@null"
android:background="#E0E0E0"
android:dividerHeight="0dp"
/>
</android.support.v4.widget.DrawerLayout>
Aber wenn ich versuche, benutze ich include wie folgt:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="5dp" >
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/category_list_view"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</ListView>
</FrameLayout>
<!-- The navigation drawer -->
<include layout="@layout/drawer"/>
</android.support.v4.widget.DrawerLayout>
Wenn ich in meinem Rahmenlayout auf die Elemente meiner Listenansicht klicke, geschieht nichts.
Dies ist das Schubladenlayout, das ich einbeziehen möchte:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="5dp" >
<!-- The navigation drawer -->
<ListView
android:id="@+id/left_drawer"
android:entries="@array/features"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="left"
android:choiceMode="singleChoice"
android:divider="@null"
android:background="#E0E0E0"
android:dividerHeight="0dp"
/>
</android.support.v4.widget.DrawerLayout>
Danke fürs Helfen!