问题描述
有没有一种方法,你可以得到动作条意见的对象引用。比如我想获得的溢出视图,以便知道屏幕上的坐标。目前我管理一个丑陋的解决方案是。得到一个菜单项与ID
overflowView =((ViewGroup中)parent.findViewById(R.id.menu_id).getParent())getChildAt(2);
只有那些你自己创建的,通过安卓actionLayout
和亲属
您的解决方案是不可能维持平稳跨越的Android版本。它可能或可能对ActionBarSherlock无法正常工作。我建议你找到任何你认为你的问题是,不涉及瞎搞与动作条
实施内部一些其他的解决办法。
Is there a way that you can get actionbar views as object references. For instance I would like to get the overflow view in order to know the coordinates on the screen. currently I have manage an ugly solution which is. Get a menu item with an id
overflowView =((ViewGroup)parent.findViewById(R.id.menu_id).getParent()).getChildAt(2);
Only the ones you create yourself, via android:actionLayout
and kin.
Your solution is unlikely to remain stable across Android versions. It may or may not work on ActionBarSherlock. I would recommend that you find some other solution for whatever you perceive your problem to be that does not involve messing around with the internals of the ActionBar
implementation.
这篇关于如何获得动作条意见的对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!