它确实显示和隐藏但它并不平滑……底部隐藏但不同的背景在消失之前一段时间.
我甚至在一个简单的hello world应用程序中尝试过,结果是一样的.
这是代码:
public voID onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentVIEw(R.layout.activity_main); TextVIEw tv = (TextVIEw) findVIEwByID(R.ID.shit); tv.setonClickListener(new OnClickListener() { public voID onClick(VIEw v) { getActionbar().hIDe(); } }); }解决方法 使用叠加模式而不是显示和隐藏 *** 作栏.
从actionbar documentation:
总结Beware that hIDing and removing the action bar causes your activity to re-layout in order to account for the space consumed by the action bar. If your activity regularly hIDes and shows the action bar (such as in the AndroID gallery app),you might want to use overlay mode. Overlay mode draws the action bar on top of your activity layout rather than in its own area of the screen. This way,your layout remains fixed when the action bar hIDes and re-appears. To enable overlay mode,create a theme for your activity and set androID:windowActionbarOverlay to true. For more information,see the section about 07001.
以上是内存溢出为你收集整理的Android:ActionBar故障显示和隐藏全部内容,希望文章能够帮你解决Android:ActionBar故障显示和隐藏所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)