drawerlayout

Remove scrollbar from android support design navigation drawer?

雨燕双飞 提交于 2020-02-01 17:25:44
问题 I just updated the support design library from 22.2.1 to 23.0.1 and immediately noticed the presence of a scrollbar in the navigation drawer. I tried to use android:scrollbars="none" But that didn't fix it. Is there any other way to remove the scrollbar? 回答1: Unfortunately the scrollbar is set in the NavigationMenuView layout not in the NavigationView , for this reason if you use android:scrollbars="none" the scrollbar is still present. You can do it programmatically calling this method:

Setting Navigation Icon on Android ActionBar

拟墨画扇 提交于 2020-01-24 05:41:04
问题 So I'm working on adding ActionBarSherlock and the Navigation Drawer to a project that previously implemented a custom (very poorly written) "action bar". Instead of using fragments and a backstack of activities for navigation, some activities show and hide different layouts. (That is, suppose I am in a list mode and then select a button to go into an edit screen. The app currently hides the list layout and shows another layout.). So I've added actionbar sherlock and a navigation drawer to

安卓开发记录(3)---仿滴滴做一个点击按钮,弹出侧边菜单

為{幸葍}努か 提交于 2020-01-17 23:53:40
前言: 制作一个类似于滴滴点击左上角头像,弹出一个侧边菜单其实特别简单。而且不需要导入任何包,直接复制几行代码即可。如果您想尝试一下,请自行new一个模板叫:Navigation Drawer Activity。自行复制代码导入项目。 1.纯净版demo 一定要看清楚使用的是v4包的项目还是AndroidX的项目,因为他们所对应的xml tag不一样。请按照自己项目,修改对应tag < ! -- v4项目头尾文件 < android . support . v4 . widget . DrawerLayout < / android . support . v4 . widget . DrawerLayout > -- > < ! -- Androidx项目头尾文件 < androidx . drawerlayout . widget . DrawerLayout < / androidx . drawerlayout . widget . DrawerLayout > -- > xml: < ? xml version = "1.0" encoding = "utf-8" ? > < android . support . v4 . widget . DrawerLayout xmlns : android = "http://schemas.android.com/apk

Kotlin APP首页主流框架搭建DrawerLayout+NavigationView+Toolbar+ViewPager+BottomNavigationView

泄露秘密 提交于 2020-01-14 22:06:24
效果 页面结构解析 这是一个比较常见的APP首页的结构,侧边栏+主页,侧边栏里是一些菜单,主页由底部菜单控制内容区,内容区是可滑动的子页面。整体比较舒服合理,各自为阵,却又能关联在一起,加上又是大众喜爱的 Material Design 风格,所以成为了当下APP首页的主流结构。 上图是做的一个简单的思维导图,并不复杂,理清了结构就能事半功倍。 页面布局 1.首页 即整个大的容器。 <?xml version="1.0" encoding="utf-8"?> <androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:context=".module

Difference between SlidingPaneLayout and NavigationDrawer

时间秒杀一切 提交于 2020-01-13 10:33:51
问题 I really don't know what is the difference between these two approaches of creating navigation menu. So I read that both can be used as a container for two fragments (main fragment, detail fragment). So can you help me to understand which approach is better and why? I can't find out relevant information. thank you. 回答1: The session was "Android Design for UI Developers" by Roman Nurik and Nick Butcher: https://developers.google.com/events/io/sessions/326204977 Pretty much what CommonsWare

Android实战简单新闻客户端(1)---主界面设计

微笑、不失礼 提交于 2020-01-12 16:23:50
模仿实例地址: SimpleNews 前言这是github开源项目,原项目有四个模块。我这里之模仿其中 一个(新闻)。学会MD开发和MVP架构。 主页布局: 这里主要使用了toolbar和DrawerLayout实现导航条以及侧滑的效果。 当然为了填充侧滑栏,又使用了NavigationView这个控件。 toolbar和DrawerLayout 我已经在前面的博客文章介绍过了: android–UI—侧滑drawerLayout android–UI–导航条toolbar NavigationView实践 使用ToolBar代替ActionBar的时候,首先去掉Actionbar 修该主题: <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> 为了使用NavigationView

Full width Navigation Drawer

痞子三分冷 提交于 2020-01-09 08:56:08
问题 I'd like to create a full width navigation drawer. Setting layout_width to match_parent on @+id/left_drawer yields in width of about 80% of screen space. This seems to be the standard behavior. Do I have to override onMeasure() of DrawerLayout ? My current code: <?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

DrawerLayout on click disabled after first event

送分小仙女□ 提交于 2020-01-06 14:58:43
问题 I'm trying to implement a drawer layout in my app. I follow the tutorial on android developer site and all goes fine. I have only a "little" problem: I lunch the app, open the drawer layout and click on an element of the list view and all goes great, but when I try to open another time the drawer and click on one of his element I noticed that the element that I've first clicked is still clicked and i'm not able to click on any of the other elements.The drawer simply close without lunching any

Disabling right drawer only on specific fragment

心不动则不痛 提交于 2020-01-03 11:13:08
问题 I have Activity with DrawerLayout (which contains left and right drawer). I was wondering if I could disable right drawer from specific fragments. I've read about mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED) , but it would lock whole drawer closed, and I still need the left drawer 回答1: DrawerLayout.setDrawerLockMode(int lockMode) locks all the drawers, but to lock a specific drawer you can use one of the following: DrawerLayout.setDrawerLockMode(int lockMode, int

toolbar not appearing in pre lollipop devices

不问归期 提交于 2020-01-01 12:25:27
问题 Toolbar is not appearing on pre lollipop devices. I'm using drawer layout with toolbar. The same toolbar works on other activities but not when used along with drawer layout. Activity with drawer layout and toolbar @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home_screen); { /*supportChatImageButton = (ImageButton) findViewById(R.id.homeSupportChatImageButton); orderImageButton = (ImageButton) findViewById