Status Bar prompt

Source: Internet
Author: User

Status Bar prompt
Status Bar prompt

@property (nonatomic, strong) UIWindow *window;@property (nonatomic, strong) UILabel *meterLabel;@end@implementation ViewController- (void)viewDidLoad {    [super viewDidLoad];    self.window = [[UIWindow alloc] initWithFrame:[UIApplication sharedApplication].statusBarFrame];    self.window.windowLevel = UIWindowLevelStatusBar + 10.0;    self.window.userInteractionEnabled = NO;        CGFloat const kMeterWidth = 165.0;    self.meterLabel = [[UILabel alloc] initWithFrame:CGRectMake((CGRectGetWidth(self.window.bounds) - kMeterWidth) / 2.0, 0.0,                                                                kMeterWidth, CGRectGetHeight(self.window.bounds))];    self.meterLabel.font = [UIFont boldSystemFontOfSize:12.0];    self.meterLabel.backgroundColor = [UIColor blackColor];    self.meterLabel.textColor = [UIColor whiteColor];    self.meterLabel.textAlignment = NSTextAlignmentCenter;    self.meterLabel.text = @"touch here to go back";    [self.window addSubview:self.meterLabel];    self.window.hidden = NO;    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{        self.window = nil;    });}


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.