UIAlertView not showing message text

前端 未结 3 631
情歌与酒
情歌与酒 2021-01-17 05:26

I am bringing up an UIAlertView that works fine in portrait layout, but when in landscape mode - the message doesn\'t appear.

It is a standard UIAlertView, with thre

3条回答
  •  鱼传尺愫
    2021-01-17 06:09

    You can directly use uialertview and create object of it. Then pass title and message and button and also other button.....And call click button method.

    //Example

    UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Title" message:@"The message."
    delegate:self cancelButtonTitle:@"button 1" otherButtonTitles:@"button", nil];
                      [alert show];
                      [alert relaese];
    
    
    //Then use this method
    
    -(void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
    {
    // the user clicked one of the ok/cancel buttons
        if(buttonIndex==0)
         {
           NSLog(@"Ok");
         }
         else
         {
         NSLog(@"cancel");
         }
    }
    

提交回复
热议问题