添加自定义图像到抽屉式导航栏的中心 [英] Adding a custom image onto a Navigation Drawer's center

查看:233
本文介绍了添加自定义图像到抽屉式导航栏的中心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经历过了第一次与Android的抽屉式导航栏。我觉得这是一个非常优雅的方式来提供一个应用程序菜单。然而,示出了我的原型一些朋友,看来它不退出直观搜索在屏幕的左侧上的左上角的菜单ⅰ)分别ⅱ)

I'm experimenting for the first time with Android's Navigation Drawer. I think it is a very elegant way to provide an application menu. However, showing my prototype to some friends, it seems that it is not quit intuitive to search for a menu i) on the top left corner respectively ii) on the left side of the screen.

要为我的情况下用户提示),我通过创建ActionBarDrawerToggle添加自定义图像。这将导致以下标题栏的设计(小箭头是对自定义图像,而红的明星是应用程序图标):

To provide a "user hint" for case i), I added a custom image by creating an ActionBarDrawerToggle. This results in following design of the title bar (the little arrow is the cutom image, while the red star is the application icon):

现在,而深化发展,我认为这是很明显的,但apparantly我错了:)。所以作为第二个想法,以支持用户查找选项ii)中所述,我试图找出如何在一个特定的地方,我想下面的图像解释进一步增加了图片:

Now while developping, I thought this is quite obvious, but apparantly I'm wrong :). So as a second idea, to support a user to find option ii) described below, I tried to figure out how to add a further image at a specific place, which I want to explain with following image:

别看设计本身摆在首位,但以下几点:图像必须被放置在视图边界(当导航菜单是隐藏的)之外,也超出了导航面板本身的权利侧(总是)。这是在任何可能的方式,而不自定义整个导航面板?我真的不知道为什么我找不到太多关于这个想法,因为我认为这是一个非常不错的选择(只要箭头不扰乱了应用程序的使用)提供给用户。

Don't look at the design itself in the first place, but following: the image must be placed outside of the "view bounds" (when the navigation menu is hidden), and also exceed the navigation panel itself on the right side (always). Is this in any way possible without customize the entire navigation panel? I really wonder why I can't find much about this idea, since I think it is a very nice option to provide for the user (as long as the arrow don't disturbs the application usage)

推荐答案

虽然我没有实际上Android的抽屉式导航,搜索测试它
你尝试把一个ImageView的在您的活动的布局?该图像将被放置在垂直的中上水平父离开。我相信这会工作(即图像会当你打开抽屉,得到推进。作为改进,你也可以改变在抽屉里的回调图像本身,让你有一个箭头指向右边,当抽屉被关闭一个箭头指向离开的时候抽屉是打开的。搜索结果
希望它帮助。

Although I haven't actually tested it with Android's Navigation Drawer,
did you try putting an imageview in your activity's layout? The image would be placed in the middle vertically and on parent left horizontally. I believe this would work (i.e. the image will get pushed when you open the drawer. As an improvement you could also change the image itself in the drawer's callbacks, so that you have an arrow pointing right when the drawer is closed and an arrow pointing left when the drawer is open.

Hope it helps.

这篇关于添加自定义图像到抽屉式导航栏的中心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆