0

I have three buttons and a textview in uialertview, and tried to move down the buttons with add "\n" in uialertview's message property. But it's not work. The string will become "..." when it reach the limit of a line. the textview always cover my buttons. Do you have any suggestions? Sorry that I don't have the right to post image.

- (void)addMessage
{   
self.addMessageAlertView = [[UIAlertView alloc] initWithTitle:@"Add Title" 
                                                      message:@"\n\n\n\n function normal function normal  function normal  function normal function normal   " 
                                                     delegate:self 
                                            cancelButtonTitle:@"Cancel" 
                                            otherButtonTitles:@"OK",@"Search", nil];
self.addMessageTextView = [[UITextView alloc] initWithFrame:CGRectMake(10.0, 75, 260.0, 25*2)];
[addMessageTextView setBackgroundColor:[UIColor whiteColor]];
addMessageTextView.font = [UIFont systemFontOfSize:20];
addMessageTextView.delegate=self;
addMessageTextView.layer.masksToBounds=YES;
addMessageTextView.layer.cornerRadius=10.0;
addMessageTextView.layer.borderWidth=0.0;
[addMessageAlertView addSubview:addMessageTextView];
[addMessageAlertView show];
[addMessageAlertView release];
[addMessageTextView release];
}

 - (void)willPresentAlertView:(UIAlertView *)openURLAlert
{
[openURLAlert setFrame:CGRectMake( 10, 60, 300, 300 )];
[openURLAlert setBounds:CGRectMake(0, 10, 290, 290 )];
}
Eric J.
  • 147,927
  • 63
  • 340
  • 553
MuddySky
  • 11
  • 6

1 Answers1

0

UIAlert view has maximum height (I've tried this same thing with no success); you won't be able to make it bigger. I suggest that you use a custom pop-over instead. A popover can act like an alert but will give you more flexibility.

This question has some links to tutorials: Are there examples of how to use UIPopoverController on iOS?

Community
  • 1
  • 1
JoshRagem
  • 575
  • 3
  • 10
  • Thanks,but I do change the frame of UIAlertView with (void)willPresentAlertView. But the problem is the "\n" not function in message property. – MuddySky Mar 12 '12 at 03:53