Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HUD with multiple lines

How can I make HUD that has multiple lines? He is my code, but the labelText is one line

HUD = [MBProgressHUD showHUDAddedTo:[[TTNavigator navigator] window] animated:YES];
HUD.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"noImage.png"]];
HUD.mode = MBProgressHUDModeCustomView;
HUD.delegate = self;
HUD.labelText = @"text1 \n text2";
[HUD hide:YES afterDelay:3];
like image 949
Luda Avatar asked Aug 13 '12 09:08

Luda


2 Answers

use detailsLabelText method, i.e.

HUD.detailsLabelText = @"your next line here"

you can change the style using detailsLabelFont.

like image 74
Jon Madison Avatar answered Sep 22 '22 19:09

Jon Madison


Easiest way (expanding on Jon Madison's answer):

hud.labelText = @"Your first line of text is";
hud.detailsLabelText = @"followed by your next line of text";
hud.detailsLabelFont = hud.labelFont;
like image 26
Fateh Khalsa Avatar answered Sep 24 '22 19:09

Fateh Khalsa