請參考
https://github.com/jdg/MBProgressHUD
直接把
MBProgressHUD.h
MBProgressHUD.m
檔案夾到專案裡就可以使用
使用方式importMBProgressHUD.h

[p[self showAllTextDialog:@"Email 格式錯誤"];


-(void)showAllTextDialog:(NSString *)str
{
    MBProgressHUD *HUD = [[MBProgressHUD alloc] initWithView:self.view];
    [self.view addSubview:HUD];
    HUD.labelText = str;
    HUD.mode = MBProgressHUDModeText;
    
    //指定距离中心点的X轴和Y轴的位置,不指定则在屏幕中间显示
    //    HUD.yOffset = 100.0f;
    //    HUD.xOffset = 100.0f;
    
    [HUD showAnimated:YES whileExecutingBlock:^{
        sleep(1);
    } completionBlock:^{
        [HUD removeFromSuperview];
        //        [HUD release];
     
    }];
    
}
arrow
arrow
    全站熱搜

    戮克 發表在 痞客邦 留言(0) 人氣()