Skip to content

Instantly share code, notes, and snippets.

@MeilCli
Created September 25, 2013 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MeilCli/6697070 to your computer and use it in GitHub Desktop.
Save MeilCli/6697070 to your computer and use it in GitHub Desktop.
サポートライブラリのDrawerLayoutのさんぷる Viewの階層が多くなるのはしょうがない()
<?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" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<!-- 何らかのView -->
</FrameLayout>
<FrameLayout android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="left"
android:divider="@android:color/transparent"
android:dividerHeight="0dp" />
<FrameLayout android:id="@+id/right_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="right"
android:divider="@android:color/transparent"
android:dividerHeight="0dp" />
<!-- 両方同時に開くとrightが上 -->
</android.support.v4.widget.DrawerLayout>
FrameLayout left = (FrameLayout)findViewById(R.id.left_drawer);
//left.addView();
//これでViewを追加する
FrameLayout right = (FrameLayout)findViewById(R.id.right_drawer);
//right.addView();
//これでViewを追加する
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment