0
MBProgressView無法在UICollectionView上等待iOS 它在其他視圖控制器中工作正常,但是當我在uicollection視圖控制器中使用時,它不在屏幕上顯示,請給我一個解決方案。MBProgressView不適用於在iOS中等待的UICollectionView
請檢查下面的鏈接
MBProgressView無法在UICollectionView上等待iOS 它在其他視圖控制器中工作正常,但是當我在uicollection視圖控制器中使用時,它不在屏幕上顯示,請給我一個解決方案。MBProgressView不適用於在iOS中等待的UICollectionView
請檢查下面的鏈接
嘗試加入上海華:
[MBProgressHUD showHUDAddedTo:self.collectionView.superview animated:YES];
UPDATE
好吧,我檢查你的代碼,這有點搞砸了。所以
- (void)viewDidDisappear:(BOOL)animated {
NSLog(@"viewDidDisappear in Main Page");
// Looks like you want to hide your HUD here.
// This code will be called right after [self.tabBarController setSelectedIndex:1],
// cause current with gonna disappear.
[MBProgressHUD hideHUDForView:self.view animated:YES];
}
,如果你真的希望看到HUD(目前還不清楚它應該是多久可見): 這裏發生:
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row == 0) {
// You about to show HUD in your current VC views hierarchy
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.collectionView.superview animated:YES];
hud.labelText = @"Loading...";
// But immediately switching to another. Current VC will be off screen.
// You will not see your HUD
[self.tabBarController setSelectedIndex:1];
}
...
然後
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row == 0) {
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.tabBarController.view];
// hide after 4 seconds
[hud hide:YES afterDelay:4];
...
嗨Orkenstein,我已經在uicollection視圖「didSelectItemAtIndexPath」方法添加同樣的事情,但它仍然沒有出現在查看@orkenstein – Koteswar 2015-02-12 05:22:45
@Koteswa請分享你的代碼。 – orkenstein 2015-02-12 06:52:40
請檢查此鏈接http://paste.ofcode.org/L7KGtcSJUqUEH7AKTrRiKY – Koteswar 2015-02-12 10:01:31