作者larry122 (larry122)
看板MacDev
标题[问题] 请问IOS10 AlertView
时间Mon Sep 19 23:06:42 2016
小弟在升级Xcode8後发现,AlertView的背景颜色似乎被另一层View盖住,
这边是DEMO的连结如下
https://drive.google.com/file/d/0Bx3rZLw6NauYcUpHc3RXNC01YTg/view?usp=sharing
很明显可以看出在IOS8.9 与10颜色不同,也附上部分程式码
UIAlertController *alertloading = [UIAlertController
alertControllerWithTitle:nil message:@""
preferredStyle:UIAlertControllerStyleAlert];
UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc]
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
spinner.center = CGPointMake(130.5, 65.5);
spinner.color = [UIColor redColor];
[spinner startAnimating];
UIView * firstView = alertloading.view.subviews.firstObject;
UIView * nextView = firstView.subviews.firstObject;
nextView.backgroundColor = [UIColor colorWithRed:20.0f/255.0f
green:20.0f/255.0f
blue:20.0f/255.0f
alpha:1.0f];
目前就是上面这边颜色改成黄色或其他也彷佛被一层看不到的挡住,
请问有人遇到类似的问题吗?
附上方便线上阅读连结
https://goo.gl/gcxItb
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 111.240.254.20
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/MacDev/M.1474297605.A.51E.html
1F:→ larry122: 附上方便阅读的连结 09/19 23:09
※ 编辑: larry122 (111.240.254.20), 09/19/2016 23:11:12
※ 编辑: larry122 (111.240.254.20), 09/19/2016 23:15:46
2F:推 tentenlee: 为什麽不直接用MBProgressHUD 要那麽复杂 09/19 23:41
3F:→ tentenlee: 显示一行搞定 结束一行搞定 09/19 23:42
5F:→ larry122: 其他专案有用 因为这是第一个当初自己写的专案 09/20 00:08
6F:→ larry122: 当初没使用半个第三方,只是想知道这问题是否有解法ORZ 09/20 00:08
7F:→ larry122: 顺便问一下MBProgressHUD 可以自订背景跟读取的颜色吗 09/20 00:10
8F:→ larry122: 我找到更换背景的了 09/20 00:11
10F:→ shinrenpan: Present 一个透明背景无 animation 的 UIViewContro 09/20 02:02
11F:→ shinrenpan: ller, 要怎客制化都行. 09/20 02:02
12F:→ larry122: 好的 我试看看 09/20 09:09