UIActivityIndi​​catorView的背景颜色 [英] Background color for UIActivityIndicatorView

查看:110
本文介绍了UIActivityIndi​​catorView的背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用UIActivityIndi​​catorView向用户显示有事情发生,让他们等待。但是UIActivityIndi​​catorView看起来很小,没有背景颜色,对用户不是很明显。虽然在iPhone SDK的UIImagePickerController,它使用类似的机制,但黑色背景以及一些文本除了指标。

I am using UIActivityIndicatorView to showing user that there is something going on, let them wait. But UIActivityIndicatorView looks small, do not have background color, and not very obvious to the user. While in iPhone SDK's UIImagePickerController, it uses the similar mechanism, but with the black background as well as some text besides the indicator.

我想知道是否有任何现有的组件

I am wondering whether there is any existing component to do that task, or I have to implement my own class to perform that task.

任何建议都非常受欢迎,先感谢。

Any suggestion are highly welcome, thanks in advance.

推荐答案

如果你只想要一个不同的背景颜色的UIActivityIndi​​ctatorView,你可以发送setBackgroundColor消息到对象,例如:

If you just want a different background color of your UIActivityIndictatorView, you could just send the setBackgroundColor message to the object, i.e.:

[activityIndicator setBackgroundColor:[UIColor blackColor]];

顺便说一下,您也可以更改指标的大小。只是做一个更大的rect的setFrame或initWithFrame。记住UIActivityIndi​​catorView从UIView继承,所以你得到所有的UIView的定制。

By the way, you can change the size of the indicator as well. just do setFrame or initWithFrame with a bigger rect. Remember UIActivityIndicatorView inherits from UIView so you get all the customization of UIView.

这篇关于UIActivityIndi​​catorView的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆