UIAlertView not displaying complete message

后端 未结 2 1695
野趣味
野趣味 2020-12-17 05:55

I have the following function to display error messages to user. But it does not seem to show the complete message. It will display upto certain characters followed by ....

相关标签:
2条回答
  • 2020-12-17 06:02

    As mentioned by sudo rm -rf, UIAlertView has a limit.

    You can try creating your own "alert" that doesn't clip by creating a view controller and showing it using presentModalViewController:animated:.

    0 讨论(0)
  • 2020-12-17 06:09

    There is a way.

    When you present your alert, you can just implement this method:

    - (void)willPresentAlertView:(UIAlertView *)alertView {
    alertView.frame = CGRectMake(alertView.frame.origin.x, alertView.frame.origin.y -50
                                 ,alertView.frame.size.width, 300);
    }
    

    Adjust the height to fit your need. It will look something like this:

    alt text

    If you need to move the button around, you can just add new lines (\n) to your message, and it will move the button down.

    0 讨论(0)
提交回复
热议问题