UIActivityIndi​​catorView微调器未显示 [英] UIActivityIndicatorView spinner not showing up

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

问题描述

我想让我的第一个微调器工作,我似乎无法让它显示在屏幕上。

I am trying to get my first spinner to work, and I can't seem to get it to show up on the screen.

我试着拖动UIActivityIndi​​catorView在我的屏幕上的故事板上,但是当我试图通过故事板将它连接到我的头文件时,它似乎没有响应。 (那里的正确步骤是什么?)

I tried dragging the UIActivityIndicatorView on the storyboard to my screen, but then when I tried to connect it to my header file via the storyboard, it didn't seem to respond. (what are the correct steps there?)

所以我手动完成了。我将此行添加到我的.h文件中:

So I did it manually. I added this line to my .h file:

@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *aSpinner;

然后我将这些行添加到我的.m文件

and then I added these lines to my .m file

UIActivityIndicatorView   *aSpinner; 

//throw up spinner from submit btn we created
aSpinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:
            UIActivityIndicatorViewStyleWhiteLarge];

[self.view addSubview:aSpinner]; 
[aSpinner startAnimating]; 

但是当我运行测试时,没有微调器显示出来。我在这里做错了什么想法?

but when I ran the test, no spinner showed up. Any thoughts on what I am doing incorrectly here?

推荐答案

在你的nib文件中选择你的微调器,右击 - >点击&从引用拖动到文件所有者。然后选择aSpinner。

Select your spinner in your nib file right click -> click & drag from reference to files owner. Then select aSpinner.

它没有显示,因为nib中的activityindicator和你的代码没有连接。

It does not show up, because activityindicator in nib and your code are not connected.

你可以在这里找到截图如何做到这一点

You can find it here with screenshots how to do that

https://developer.apple.com/library/ios/#documentation/ IDE / Conceptual / xcode_quick_start / 020-Tutorial_Designing_a_User_Interface_with_Interface_Builder / interface_builder_tutorial.html#// apple_ref / doc / uid / TP40010575-CH3-SW3

这篇关于UIActivityIndi​​catorView微调器未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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