平常actionbar都是顶部显示,现在想底部显示,原生actionbar只用在配置里面添加android:uiOptions="splitActionBarWhenNarrow"就可以在底部显示了,但是我现在是用的自定义actionbar,这句话就没有用了,求有经验的人说下,或者给demo
我现在有种思路
ActionBar actionBar = getSupportActionBar( );然后去getWindow()去设置actionbar的屏幕位置,但是anctionbar里面没有getwindow这个方法
if( null != actionBar ){
actionBar.setDisplayShowHomeEnabled( false );
actionBar.setDisplayShowCustomEnabled(true);
LayoutInflater inflator = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflator.inflate(R.layout.actionbar_bottom, null);
ActionBar.LayoutParams layout = new ActionBar.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
actionBar.setCustomView(v,layout);
}
------解决方案--------------------
Android不是开源的么,看看ActionBar是怎么处理的...
如果是自定义的View中可以使用
getParentActivity().getWindow()
------解决方案--------------------
自定义ActionBar?是自定义actionbar的CustomView吧?
不知你的actionbar是用的哪个,support的还是actionbarsherlock
------解决方案--------------------
这样的需求倒是遇到过,当时好像是用的tabhost。
------解决方案--------------------
额,我一开始也想用tabhost,但是屏幕中间有个控件,需要一直存在,如果用tab切换的话,那就无法实现了,,
让那个view不属于任何子Activity,悬浮在MainActivity上不可以吗?