MBProgressHUD to show label text in more than one line

后端 未结 4 1809
情深已故
情深已故 2021-02-05 09:03

Hi i have a MBProgressHUD on my iPad screen. Works perfectly fine. But i want to change the label to show in three lines.Like this

    self.hud =  [[MBProgressHU         


        
4条回答
  •  孤独总比滥情好
    2021-02-05 09:32

    MBProgressHUD's detailsLabelText property is multiline but not labelText property.

    So, you can try something like this

    MBProgressHUD * hud =  [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    hud.frame = CGRectMake(0, 0, 120, 143);
    
    hud.mode = MBProgressHUDModeAnnularDeterminate;
    NSString *strloadingText = [NSString stringWithFormat:@"Loading Data."];
    NSString *strloadingText2 = [NSString stringWithFormat:@" Please Wait.\r 1-2 Minutes"];
    
    NSLog(@"the loading text will be %@",strloadingText);
    hud.labelText = strloadingText;
    hud.detailsLabelText=strloadingText2;
    

    You can set detailsLabelText font by using the property detailsLabelFont.

提交回复
热议问题