Adding TextField to UIAlertView

前端 未结 9 1363
不知归路
不知归路 2021-02-12 12:38

I need to add a TextField to an UIAlertView. I understand that apple discourage this approach. So is there any library that i could make use of to add

9条回答
  •  囚心锁ツ
    2021-02-12 12:58

    Unfortunately the only official API for this is iOS 5 and up, it's a property called alertViewStyle which can be set to the following parameters:

    UIAlertViewStyleDefault
    UIAlertViewStyleSecureTextInput
    UIAlertViewStylePlainTextInput
    UIAlertViewStyleLoginAndPasswordInput
    

    UIAlertViewStylePlainTextInput being the one you want.

    Messing with the view hierarchy as described above is strongly discouraged by Apple.

提交回复
热议问题