你如何用MBProgressHud加载视图替换PFQueryTableViewController的库存加载视图?

时间:2014-06-11 22:39:40

标签: ios parse-platform mbprogresshud

Parse.com的view库存加载PFQueryTVC。但是,我想自定义它并实现MBProgressHUD's加载视图的样式。有没有人完成这个或类似的东西,并有任何提示分享?

1 个答案:

答案 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