【发布时间】:2013-05-02 17:17:10
【问题描述】:
在活动中移除操作栏的正确方法是什么?
我的活动扩展了 org.holoeverywhere.app.Activity
我有一个扩展 org.holoeverywhere.app.Application 的自定义应用程序类,并在启动时执行此静态代码:
ThemeManager.setDefaultTheme(ThemeManager.DARK);
ThemeManager.map(ThemeManager.DARK, R.style.Holo_Demo_Theme);
ThemeManager.map(ThemeManager.LIGHT, R.style.Holo_Demo_Theme_Light);
ThemeManager.map(ThemeManager.MIXED, R.style.Holo_Demo_Theme_Light_DarkActionBar);
ThemeManager.map(ThemeManager.DARK | ThemeManager.FULLSCREEN, R.style.Holo_Demo_Theme_Fullscreen);
ThemeManager.map(ThemeManager.LIGHT | ThemeManager.FULLSCREEN, R.style.Holo_Demo_Theme_Light_Fullscreen);
ThemeManager.map(ThemeManager.MIXED | ThemeManager.FULLSCREEN, R.style.Holo_Demo_Theme_Light_DarkActionBar_Fullscreen);
在我的活动中:
protected void onCreate(Bundle savedInstanceState) {
ThemeManager.removeTheme(this);
setTheme(ThemeManager.DARK | ThemeManager.FULLSCREEN);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
如果我在代码中添加requestWindowFeature(Window.FEATURE_NO_TITLE),则在android 4.1.1 -table 上删除该栏
在手机上时-android 2.3.3- 栏不会被移除。
在引入 holoeverywhere 之前,只需 requestWindowFeature(Window.FEATURE_NO_TITLE). 一切正常
在运行时删除 holoeverywhere 中的操作栏的正确方法是什么? (我想在运行时这样做,因为用户可以选择设置 DARK 或 LIGHT 布局,默认为 DARK)
【问题讨论】:
标签: android android-layout android-widget android-holo-everywhere