你好,歡迎來到IOS教程網

 Ios教程網 >> IOS編程開發 >> IOS開發綜合 >> iOS-iphone自定義狀態欄

iOS-iphone自定義狀態欄

編輯:IOS開發綜合
-(void)setRefreshWindow{
    CGRect frame = CGRectMake(0.0, 0.0, 320.0, 20.0);
    statusbarWindow = [[UIWindow alloc] initWithFrame:frame];
    [statusbarWindow setBackgroundColor:[UIColor clearColor]];
    [statusbarWindow setWindowLevel:UIWindowLevelStatusBar+1.0f];
   
    // 添加自定義子視圖
    UIImageView *customView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 0, 120, 18)];
    customView.image=[UIImage imageNamed:@"數據刷新欄.png"];
   
//    UILabel *label=[[UILabel alloc] initWithFrame:CGRectMake(100, 0, 100, 20)];
//    //    label.backgroundColor=[UIColor clearColor];
//    label.text=@"數據正在刷新";
//    [customView addSubview:label];
    [statusbarWindow addSubview:customView];
    [statusbarWindow makeKeyAndVisible];



摘自  shijiucdy的專欄 
  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved