HDAlertView類(lèi)似 iOS alertView 彈窗組件
HDAlertView是一個(gè)類(lèi)似系統(tǒng)alertView彈窗。
系統(tǒng)自帶UIAlertView有常見(jiàn)BUG, 比如和系統(tǒng)鍵盤(pán)動(dòng)畫(huà)沖突等等, 需要代理操作等諸多不方便使用. 使用UIAlertController就不會(huì)有UIAlertView等等問(wèn)題, 但是又不支持iOS7.所以才自定義一個(gè)類(lèi)似系統(tǒng)的UIAlertView, 用法和UIAlertController相似, 而且簡(jiǎn)單.
示例代碼:
HDAlertView *alertView = [HDAlertView alertViewWithTitle:@"HDAlertView" andMessage:@"similar system UIAlertView"];
[alertView addButtonWithTitle:@"ok" type:HDAlertViewButtonTypeDefault handler:^(HDAlertView *alertView) {
NSLog(@"ok");
}];
[alertView addButtonWithTitle:@"cancel" type:HDAlertViewButtonTypeDefault handler:^(HDAlertView *alertView) {
NSLog(@"cancel");
}];
[alertView show];
如果在使用過(guò)程中遇到BUG, 希望你能Issues我. 如果對(duì)你有所幫助請(qǐng)Star
評(píng)論
圖片
表情
