2

Hi i want to show my alertview message on large font so user can read proper when i run but it show me as small only how to resie font of message according to ipad i try this but it not working for me what to in my code help me on this

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
    UIAlertView* alert=[[UIAlertView alloc] initWithTitle:@"Flight Search" message:@"Please select both outbound and inbound flights" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
    //UIAlertView* alert = [[[UIAlertView alloc] init]initWithFrame:CGRectMake(100,0,340,200)];// message:@"Please select both outbound and inbound flights" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
    //[alert setTitle:@"Flight Search"];
    //[alert setCenter:CGPointMake(160.0f, 240.0f)];
    //alert.frame = CGRectMake( 100, 0, 600, 500 );
    //[alert setNeedsLayout];

    [alert show];
    alert.frame = CGRectMake( 0, 0, 340, 200 );
    //alert.frame = CGRectMake( 100, 0, 600, 250 );
    [alert release];
}
else {
    UIAlertView* alert=[[UIAlertView alloc] initWithTitle:@"Flight Search" message:@"Please select both outbound and inbound flights" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alert show];
    [alert release];
}
Cyprian
  • 9,423
  • 4
  • 39
  • 73
Rocky
  • 1,427
  • 1
  • 28
  • 65

4 Answers4

1

default UIALertView cannot be modified as per Apple's Documentation , Instead make your own Custom AlertView

Subbu
  • 2,063
  • 4
  • 29
  • 42
1

From the UIAlertView docs:

The UIAlertView class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified.

You can't modify it.

Check this question/response to find out how to make a custom alert view:

Community
  • 1
  • 1
Cyprian
  • 9,423
  • 4
  • 39
  • 73
0

UIAlertView have UITextView inside with two or single button. So that's why it can expends over vertically but not Horizontally according to input. If you need to expand it ,increase message contents but you r not able to change font size.

Sudesh Kumar
  • 569
  • 3
  • 13
  • if the message i type in the message field spans 2 rows, the alert view should adjust its vertical size automatically? somehow mine just shows the text under the text box. help? – Denis Feb 27 '12 at 07:40
0

You can do any thing with the default alert view. It will re size according to the text you have written. if you want to, then you need to create your own custom alert view. Check the link. put custom image and buttons and then you will be able to re size it.

Community
  • 1
  • 1
V.V
  • 3,082
  • 7
  • 49
  • 83