您的位置:首页 > 移动开发 > IOS开发

iOS-iphone自定义状态栏

2016-04-06 15:05 399 查看
-(void)setRefreshWindow{

CGRect frame = CGRectMake(0.0,0.0,
320.0,20.0);

statusbarWindow = [[UIWindow
alloc] initWithFrame:frame];
[statusbarWindowsetBackgroundColor:[UIColorclearColor]];
[statusbarWindowsetWindowLevel:UIWindowLevelStatusBar+1.0f];

//添加自定义子视图

UIImageView *customView = [[UIImageViewalloc]
initWithFrame:CGRectMake(100,0,
120, 18)];
customView.image=[UIImageimageNamed:@"数据刷新栏.png"];

// UILabel *label=[[UILabel alloc] initWithFrame:CGRectMake(100, 0, 100, 20)];
// // label.backgroundColor=[UIColor clearColor];
// label.text=@"数据正在刷新";
// [customView addSubview:label];
[statusbarWindowaddSubview:customView];
[statusbarWindowmakeKeyAndVisible];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: