滚动视图和 MBProgressHUD
我是 iPhone 开发新手。我在这里所做的是,加载一个带有滚动视图的视图,在该视图上显示图片。 我的应用程序中有一个基本的导航控制器.. 现在,在加载图片期间,如果图片未完全加载,我想添加 MBProgressHUD.. 我正在使用以下代码,但是,尽管在视图上添加了平视显示器,但无法在滚动视图前面看到它,因为我无法移动滚动视图。
HUD = [[MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES] retain];
[[self.view superview] bringSubviewToFront:self.navigationController.view];
请提出任何建议...感谢您的帮助..
I am new to iphone development. What i have done here is, loading a view with a scroll view on which I m showing pictures.
I have got a basic navigation controller in the app..
Now, during the loading of picture if the picture is not fully loaded i want to add a MBProgressHUD..
I m using the following code for that but, not able to see the it infront of the scroll view although the hud is added on the view as i am unable to move the scroll View..
HUD = [[MBProgressHUD showHUDAddedTo:self.navigationController.view animated:YES] retain];
[[self.view superview] bringSubviewToFront:self.navigationController.view];
Any Suggestions please... Thanks for your help..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
基于 RuiAAPeres 的答案,这里有一些更完整的 Swift 代码:
Building on RuiAAPeres's answer, here's some more complete code in Swift:
无论是滚动视图还是表格视图,您可以参考以下链接
将MBProgressHUD添加到tableView或scrollView中心
Whether its scrollview or tableview, you can refer the following link
MBProgressHUD at center added to tableView or scrollView
假设当你这样做时:
你得到一个
UIImageView
,你可以这样做:Assuming when you do:
You get an
UIImageView
, you can do something like: