まず、この質問が以前にここに表示されたことを知っていますが、多くのことを試みた後もまだ成功しませんでした. 私はAndroid Developers siteの例に取り組んでい ます。
例での実装方法(左から右)ではなく、メニューを右から左に開くように設定しようとしています。さらに、メニューを開くボタンをアクションバーの右側に移動したいと考えています。また、この回答など、ここでいくつかの回答を赤くします。
ビューとレイアウトの重力を変更しようとしましたが、エラーが発生しました:
絶対重力 LEFT でドロワー ビューが見つかりません
私のコードの問題点と、メニューを右から開くように設定し、アクション バー ボタンを右側に移動するには、何を変更すればよいかを教えてください。
xml コードは次のとおりです。
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_gravity="right"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:id="@+id/content_frame"
android:layoutDirection="rtl"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<ListView android:id="@+id/left_drawer"
android:layout_width="200dp"
android:layout_height="match_parent"
android:layout_gravity="right"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="10dp"
android:background="#111"/>
</android.support.v4.widget.DrawerLayout>