How to show UIView only when i received all data from server

点点圈 提交于 2019-12-13 00:45:52

问题


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.

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???

EDIT:

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:


1)In viewDidLoad method you can add another temporary view with dark gray background color.

2)Add activity indicator in this temporary view & start that indicator and set user interaction disable for self view.

3)In connectionDidFinishLoading stop the indicator & remove temporary view and enable user interaction of self view.




回答2:


You can add a overlay of darker color and an UIActivityIndicator, make the userInteraction disabled for that period for time



来源:https://stackoverflow.com/questions/19512565/how-to-show-uiview-only-when-i-received-all-data-from-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!