很多時(shí)候,iOS開發(fā)中需要彈出提示框來提示用戶一些信息,但是MBProgressHud的顯示可能會(huì)導(dǎo)致文字顯示不全,這個(gè)時(shí)候就需要自定義一個(gè)彈出框來顯示自己需要的文字.
-(void)updataWindows {
windows = [UIApplication sharedApplication].keyWindow;
view = [[UIView alloc]initWithFrame:CGRectMake(40, SCREEN_HEIGHT/2 - 40, SCREEN_WIDTH - 80, 80)];
view.backgroundColor = [UIColor blackColor];
view.layer.masksToBounds = YES;
view.layer.cornerRadius = 8.0f;
label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, view.bounds.size.width, 80)];
label.numberOfLines = 3;
label.text = @" 您的信息已經(jīng)重新提交表蝙,我們正在在加緊審核,請(qǐng)稍侯 ";
label.textColor = [UIColor whiteColor];
label.textAlignment = NSTextAlignmentCenter;
[windows addSubview:view];
[view addSubview:label];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)),dispatch_get_main_queue(), ^{
//2秒以后移除view
[view removeFromSuperview];
});
}
文/ZsilenceY(簡(jiǎn)書作者)
原文鏈接:http://www.reibang.com/p/a7cd52ce8d08
著作權(quán)歸作者所有乓旗,轉(zhuǎn)載請(qǐng)聯(lián)系作者獲得授權(quán)府蛇,并標(biāo)注“簡(jiǎn)書作者”。