android 侧滑效果,android 侧滑效果
布局
使用的控件是:
android.support.v4.widget.DrawerLayout
主界面的布局
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="cfeng.cn.com.dralayoutmenu.MainActivity"
tools:openDrawer="start">
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer"
/>
@layout/app_bar_main? 是顯示的主界面
android.support.design.widget.NavigationView 是側滑界面容器
android:layout_gravity="end"
android:layout_gravity="end"??? 是抽屜的打開方向
問題我想做一個新的需求 :側滑界面不和這個一樣怎么辦呢?
沒辦法只能夠寫在 @layout/nav_header_main 可以自定義布局
總結
以上是生活随笔為你收集整理的android 侧滑效果,android 侧滑效果的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C/C++ OpenCV五种滤波器综合示
- 下一篇: Centos7,配置防火墙,开启端口