Parse.com的view
库存加载PFQueryTVC
。但是,我想自定义它并实现MBProgressHUD's
加载视图的样式。有没有人完成这个或类似的东西,并有任何提示分享?
答案 0 :(得分:1)
我会尝试找到一个加载视图的子视图,然后删除它并将MBProgressHUD放在其位置。代码:
for (UIView *subview in self.view.subviews)
{
if ([subview class] == NSClassFromString(@"PFLoadingView"))
{
// find the loading label and loading activity indicator inside the PFLoadingView subviews
for (UIView *loadingViewSubview in subview.subviews) {
if ([loadingViewSubview isKindOfClass:[UILabel class]])
{
UILabel *label = (UILabel *)loadingViewSubview;
//code to remove and put in new view.
}
if ([loadingViewSubview isKindOfClass:[UIActivityIndicatorView class]])
{
UIActivityIndicatorView *activityIndicatorView = (UIActivityIndicatorView *)loadingViewSubview;
//code to remove and put in new view.
}
}
}
}
在此处获得for循环的信用:https://gist.github.com/chrisvoss/3416639