Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Create a drawer layout

$
0
0

I'm trying to create a drawer layout as shown in the Android documentation.

developer.android.com/training/implementing-navigation/nav-drawer.html

I included in the reference the assembly Mono.Android.Support.v4. My project is targeting the Android 4.0.

The layout:

<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">
    <!-- The main content view -->
    <FrameLayout
        android:id="@+id/content_frame"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    <!-- The navigation drawer -->
    <ListView android:id="@+id/left_drawer"
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:choiceMode="singleChoice"
        android:divider="@android:color/transparent"
        android:dividerHeight="0dp"
        android:background="#111"/>
</android.support.v4.widget.DrawerLayout>

The compilation works without errors but when I access the activity the following exception is generated:

android.view.Exception: Binary XML file #1: Error inflating class android.support.v4.widget.DrawerLayout.

Does anyone have succeeded in using a Navigation Drawer with Mono for Android?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>