作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有几个以编程方式生成的 UIButton(自定义,200 x 200,白色背景),我想在其中放置一个 UIActivityIndicatorView。我尝试使用以下代码:
UIActivityIndicatorView *playlistImageLoader = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
playlistImageLoader.center = CGPointMake(100, 100);
playlistImageLoader.hidesWhenStopped = YES;
[playlistImage addSubview:playlistImageLoader];
[mainScrollView addSubview:playlistImage];
[playlistImageLoader startAnimating];
最佳答案
您没有设置指示器框架,设置它,将它作为按钮 subview 就可以了。
尝试使用 UIActivityIndicatorViewStyleGray
- UIActivityIndicatorViewStyleWhite
在白色背景上是不可见的。
关于objective-c - UIButton里面的UIActivityIndicatorView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12360259/
我是一名优秀的程序员,十分优秀!