UITextField in UIAlertView alternative?

前端 未结 4 430
逝去的感伤
逝去的感伤 2021-01-15 21:56

I want a quick input from a user. I know I can put a UITextField in UIAlertView but it\'s sort of a \"hack\". Is there an official/alternative way to do this?

It\'s

4条回答
  •  南笙
    南笙 (楼主)
    2021-01-15 22:22

    I had the exact same problem and have fixed it and seems to work in both iOS 4.3 and 5.0. It seems there are some other classes further down throwing off the computing of the offsetY value. Instead of updating offsetY for all non-UIControl classes I changed it to only update it for UILabel classes.

    Here is my fix in EGOTextFieldAlertView.m in layoutSubviews

    change this line: if(![view isKindOfClass:[UIControl class]]) {
    to: if([view isKindOfClass:[UILabel class]]) {

提交回复
热议问题