*** Assertion failure in -[MBProgressHUD initWithView:],
来源:互联网 发布:平湖市行知小学足球 编辑:程序博客网 时间:2024/06/05 18:12
* Assertion failure in -[MBProgressHUD initWithView:],
完美解决方式:创建一个类别,将showHUDAddedTo二次封装为showHUDAddedToView,在程序种调用showHUDAddedToView即可,相对原先调用只是多了一个View单词而已,原理是在View为nil时候,加在window上
+(MBProgressHUD *)showHUDAddedToWindowAnimated:(BOOL)animated{
UIWindow * keyWindow = [UIApplication sharedApplication].keyWindow;MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:keyWindow animated:animated];return hud;
}
+(MBProgressHUD )showHUDAddedToView:(UIView )view animated:(BOOL)animated{
MBProgressHUD *hud = nil;if (view != nil) { hud = [MBProgressHUD showHUDAddedTo:view animated:animated];}else{ hud = [MBProgressHUD showHUDAddedToWindowAnimated:animated];}return hud;
}
+(void)showToastWithTips:(NSString )tips offset:(CGPoint)offset inView:(UIView )inView{
MBProgressHUD *hud = [MBProgressHUD showHUDAddedToView:inView animated:YES];// Set the text mode to show only text.hud.mode = MBProgressHUDModeText;hud.label.text = tips;hud.bezelView.backgroundColor = kC_ThemeCOLOR;hud.offset = offset;[hud hideAnimated:YES afterDelay:1.5f];
}
链接:https://share.weiyun.com/4eec5a93fa4985a895404942871a6e21 (密码:y7YICF)
阅读全文
0 0
- *** Assertion failure in -[MBProgressHUD initWithView:],
- Assertion failure in -[GPUImageMovieWriter createDataFBO]
- *** Assertion failure in -[UITableView _endCellAnimationsWithContext:]
- Assertion failure in -[UIView layoutSublayersOfLayer:],
- Assertion failure in -[UICGColor encodeWithCoder:]
- *** Assertion failure in -[UITableView layoutSublayersOfLayer:]
- Assertion failure in -[UIView layoutSublayersOfLayer:]
- Assertion failure in -[MASViewConstraint install]
- *** Assertion failure in -[UICollectionViewData validateLayoutInRect:]
- Assertion failure in -[UICollectionView layoutSublayersOfLayer:]
- Assertion failure in -[UITableView layoutSublayersOfLayer:]
- Assertion failure in -[UICollectionViewData validateLayoutInRect:],
- Assertion failure in -[XXX addChild:z:tag:]
- Assertion failure in -[UITableView _endCellAnimationsWithContext:]---错误
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- Assertion failure in -[SKSTableView _configureCellForDisplay:forIndexPath:]
- 移动端-rem使用
- TCPIP建立和数据传输过程
- 微信公众号:js-sdk初始化流程图记录
- PAT 1076. Forwards on Weibo (30)
- Spring+SpringMVC+SpingDataJPA(基于Hibernate)框架搭建
- *** Assertion failure in -[MBProgressHUD initWithView:],
- ARM(rk3036)平台编译Ne10开源库
- Linux更改字符集
- ajax 工作原理
- [Leetcode] 389. Find the Difference 解题报告
- python中的print遇到\r回车符的时候
- leetcode 671. Second Minimum Node In a Binary Tree
- Enum-枚举的正确使用
- Android状态栏微技巧,带你真正理解沉浸式模式