如何使用ios7在UIAlertView中添加UIActivityIndi​​catorView?

时间:2013-06-20 02:57:39

标签: uialertview uiactivityindicatorview ios7

我想弄清楚如何在ios7上创建带有进度指示器的对话框。

在我使用的旧版本(适用于ios6)代码中:

// ... init alertview ...

indicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(125, 55 + hlines, 30, 30)];
int height = self.frame.size.height + indicator.frame.size.height - 20;
[alert addSubview:indicator];
indicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
[indicator startAnimating];

[alert setFrame:CGRectMake(self.frame.origin.x, self.frame.origin.y, self.frame.size.width, height)];

有什么想法吗?

0 个答案:

没有答案