在状态栏上添加控件

UIView *bar = [[UIApplication sharedApplication] valueForKey:@"statusBar"];
    bar.backgroundColor = [UIColor clearColor];
    UIView *view = [UIView new];
    view.backgroundColor = [UIColor redColor];
    view.frame = bar.bounds;
    [bar addSubview: view];

你可能感兴趣的:(在状态栏上添加控件)