在最新版本的微信,新浪微博等应用中都使用到了状态栏的自定义功能:

iphone上自定义状态栏效果的实现

效果很酷,实现很简单:

    // 初始化一个状态条级别的window
CGRect frame = CGRectMake(0.0, 0.0, 320.0, 20.0);
UIWindow* statusbarWindow = [[UIWindow alloc] initWithFrame:frame];
[statusbarWindow setBackgroundColor:[UIColor clearColor]];
[statusbarWindow setWindowLevel:UIWindowLevelStatusBar];

// 添加自定义子视图
UIView *customView = [[UIView alloc] initWithFrame:frame];
// ...(各种对视图的定制)
[statusbarWindow addSubview:customView];
[statusbarWindow makeKeyAndVisible];



相关文章:

  • 2021-04-01
  • 2021-11-23
  • 2022-02-01
  • 2021-12-18
  • 2021-12-19
  • 2021-11-23
  • 2021-12-03
  • 2021-11-24
猜你喜欢
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
  • 2021-04-17
相关资源
相似解决方案