izan
izan

Reputation: 737

How to prevent UIAlertView from word wrapping

i have an Alert view, i have put a text in the message property,

message:@" my Text is .... ?";

when the alert view is shown, i have my text shown in one line and the "?" shown in other line, how can i show all my message Text in one line ?? thanks for your answer

Upvotes: 0

Views: 550

Answers (3)

AechoLiu
AechoLiu

Reputation: 18378

If you want to control the behavior of UIAlertView, I suggest to sub-class UIWindow and implement one custom alertView by self.

Upvotes: 0

Aman Aggarwal
Aman Aggarwal

Reputation: 3754

Try this code , as i tested it and message was shown in single line

UIAlertView *alerrt = [[UIAlertView alloc]initWithTitle:@"test" message:@" my Text is .... ?" delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil];
[alerrt show];
[alerrt release];

Upvotes: 0

deanWombourne
deanWombourne

Reputation: 38475

I think that your text is probably too long to fit on one line.

You could force word wrap by removing the space between your text and the question mark?

message:@" my Text is ....?";

Upvotes: 1

Related Questions