How to hide title/message frame in a UIAlertController?

后端 未结 5 617
粉色の甜心
粉色の甜心 2020-12-24 05:02

When using a UIAlertController, if I want to present a UIActionSheet with an empty title and an empty message, the frame for the expected placement

5条回答
  •  时光说笑
    2020-12-24 05:43

    UIAlertController *controller=[UIAlertController alertControllerWithTitle:@"" message:@"" preferredStyle:UIAlertControllerStyleAlert];//style check

    UIAlertAction *first = [UIAlertAction actionWithTitle: @"Login with Facebook" style: UIAlertActionStyleDefault handler:^(UIAlertAction *action)
    {
       //write to perform action
    
    }];
    
    
    [controller addAction: first];
    
    
    
    UIAlertAction *second = [UIAlertAction actionWithTitle: @"Guest User" style: UIAlertActionStyleDefault handler:^(UIAlertAction *action)
    

    { //write to perform action

    }];
    
    [controller addAction:second];
    
    
    UIAlertAction *third=[UIAlertAction actionWithTitle:@"Registered User" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action)
    
    
    {
        //write to perform action
    
    }];
    
    [controller addAction:third];
    
    [self presentViewController: controller animated: YES completion: nil];
    

提交回复
热议问题