Sar*_*mer 5 android android-layout navigation-drawer
我想让我的NavigationDrawer就像在这个应用程序中一样
更具体地说,我想在右侧添加一个小的1像素边框
但这是我抽屉里的东西
这是抽屉片段的xml
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E7E7E7"
android:choiceMode="singleChoice"
android:dividerHeight="0.5dp" />
Run Code Online (Sandbox Code Playgroud)
我需要做什么?
尝试这个,
DrawerLayout mDrawerLayout;
onCreate(Bundle ...){
//...
mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow,
GravityCompat.START);
//...
}
Run Code Online (Sandbox Code Playgroud)
编辑
您需要添加一个View
并用一个水平ListView
包裹两个并给两个都一些重量。这里我给了权重和权重 to ,你可以根据你的要求改变它。LinearLayout
0.99
listView
0.01
view
<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" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ListView android:id="@+id/drawer_list"
android:layout_weight="0.99"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E7E7E7"
android:choiceMode="singleChoice"
android:dividerHeight="0.5dp" />
<View
android:layout_weight="0.01"
android:layout_width="0dp"
android:layout_height="match_parent"
android:background="#eeccbb"/>
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3687 次 |
最近记录: |