机器人 - 机器人操作栏的改变位置 [英] Android - Change position of android action bar

查看:141
本文介绍了机器人 - 机器人操作栏的改变位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立一个像Facebook和路径的应用 滑出菜单。我想放置的操作栏右端的一个按钮,将触发打开和关闭菜单。当菜单会滑动,以使自己可见我想滑出对一起操作栏左侧的主视图。

I am trying to build a slide out menu like Facebook and Path apps. I want to place a button on right end of action bar which would trigger opening and closing the menu. When the menu would slide in to make itself visible I want to slide out the main view towards left along with the action bar.

其他一切工作正常。我使用的是开源$ C ​​$ C可在 - https://github.com/ gitgrimbo / Android的滑动菜单演示

Everything else works fine. I am using the open source code available at - https://github.com/gitgrimbo/android-sliding-menu-demo

但我不能找出我是否可以申请幻灯片动画的动作扎得?如果不是这样,设计自己的操作栏,并包括活动的布局是要走的路,我相信。 我想在这个问题上AP preciate任何专家的指导。

But I am not able to find out if I can apply slide animation to the action bar too? If not, designing my own action bar and including in activity layouts is the way to go I believe. I would appreciate any expert guidance in this matter.

推荐答案

要尽我所知,这是不可能的。在ActionBar对象不从View继承,所以你不能得到任何的布局参数。我认为,这实际上是驻留在被提供给您的活动窗外。所以对于影响你所描述的,自定义操作栏可能是为了。另外,您也可以考虑有一个透明/半透明的操作栏覆盖你的活动,你显示/隐藏时面板弹出(如上文的这里) - 只是一个想法,但最终你觉得什么提供了最好的UX为您的应用

To the best of my knowledge, this isn't possible. The ActionBar object doesn't inherit from View, so you can't get any of the layout parameters. I believe that it actually resides outside of the window that gets supplied to your activity. So for the effect you're describing, a custom action bar might be in order. Alternatively, you might consider have a transparent/ translucent action bar overlaying your activity, that you show/hide when that panel pops out (as mentioned here) - just a thought, but ultimately do what you feel offers the best UX for your application.

这篇关于机器人 - 机器人操作栏的改变位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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