How to move the buttons in a UIAlertView to make room for an inserted UITextField?

后端 未结 8 765
挽巷
挽巷 2020-12-24 00:07

[EDIT] Hmm. Perhaps this question should be titled \"what is the default user-input dialog view called in CocoaTouch?\" I realize that I can create an entire view that is

8条回答
  •  醉话见心
    2020-12-24 00:16

    Most probably You would want to look into the addTextFieldWithValue method of the UIAlertView? Add the following code somewhere at the top of Your class:

    @interface UIAlertView ()
    - (void) addTextFieldWithValue: (NSString*) val label: (NSString*) label;
    - (UITextField*) textField;
    @end
    

    It’s not official, but IMHO it’s not getting You rejected from the App store and it’s much better solution than hacking the textfield into the dialog Yourself.

提交回复
热议问题