# 状态栏 ## 声明与定义 声明: ~~~ #ifndef _SYSAPP_STATUSBAR_H_ #define _SYSAPP_STATUSBAR_H_ #include "app/SysAppFactory.h" class StatusBar : public BaseApp { public: StatusBar(); virtual ~StatusBar(); virtual void onCreate(); protected: virtual const char* getAppName() const { return "statusbar.ftu"; } }; #endif } ~~~ 定义: ~~~ #include "Statusbar.h" #include "entry/EasyUIContext.h" /* 注册状态栏,APP_TYPE_SYS_STATUSBAR为状态栏类型 */ REGISTER_SYSAPP(APP_TYPE_SYS_STATUSBAR, StatusBar); StatusBar::StatusBar() { } StatusBar::~StatusBar() { } void StatusBar::onCreate() { BaseApp::onCreate(); } ~~~ ## 操作状态栏 显示状态栏: ~~~ EASYUICONTEXT->showStatusBar(); ~~~ 隐藏状态栏: ~~~ EASYUICONTEXT->hideStatusBar(); ~~~ 注意: 编辑statusbar.ftu的UI时需设置主窗口置顶,设置为非全屏模式