UIActionSheet/UIAlertController multiline text

前端 未结 4 1223
孤城傲影
孤城傲影 2021-01-13 05:34

This is the code I am writing to display UIActionSheet.

actionSheet = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@\"updateresponse         


        
4条回答
  •  春和景丽
    2021-01-13 05:46

    try this

    let alert = UIAlertController(title: title,
                                  message: "you message go here",
                                  preferredStyle: 
    UIAlertControllerStyle.alert)
    
    let cancelAction = UIAlertAction(title: "Cancel",
                                     style: .cancel, handler: nil)
    
    alert.addAction(cancelAction)
    self.present(alert, animated: true, completion: nil)
    
    UILabel.appearance(whenContainedInInstancesOf: 
    [UIAlertController.self]).numberOfLines = 0
    
    UILabel.appearance(whenContainedInInstancesOf: 
    [UIAlertController.self]).lineBreakMode = .byWordWrapping
    

提交回复
热议问题