仅当我从服务器收到所有数据时如何显示 UIView [英] How to show UIView only when i received all data from server
问题描述
我正在我的应用程序中从服务器获取数据.目前我使用 NSUrlConnection 并在 connectionDidFinishLoading
中获取数据.意思是当我向用户显示 alertView 时.但那时我的观点没有更新数据.
I am getting data from server in my application. Currently I making this using NSUrlConnection and getting data in connectionDidFinishLoading
. Mean while i am showing an alertView to user. but that time my view is not updated with data.
我只能在整个响应来自服务器并稍后刷新视图时显示.
I can only show while whole response is came form server and refreshing the view later.
我可以将视图限制为仅在获取整个响应时显示,还是可以使 uialertview 的暗效果更暗,从而禁用包含视图???
Can i restrict view to shown up only when whole response is acquired or can i make the that dark effect of uialertview more dark which make containing view disable???
从所有答案中,我想知道我可以使 UIAlertView 的灰色效果更暗,还是可以将其更改为其他颜色?或者有人可以解释一下它是如何显示的??
From all answers i would like to know that can i make gray effect of UIAlertView more dark or may i change it with other color ? or can someone explain me how its shown up ??
推荐答案
1)在 viewDidLoad 方法中,您可以添加另一个具有深灰色背景色的临时视图.
1)In viewDidLoad method you can add another temporary view with dark gray background color.
2) 在这个临时视图中添加活动指示器 &启动该指示器并为自身视图设置用户交互禁用.
2)Add activity indicator in this temporary view & start that indicator and set user interaction disable for self view.
3)在连接中DidFinishLoading停止指标&删除临时视图并启用用户交互.
3)In connectionDidFinishLoading stop the indicator & remove temporary view and enable user interaction of self view.
这篇关于仅当我从服务器收到所有数据时如何显示 UIView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!