我已经安装了iOS11 beta5并捕获了一些问题。我为我的自定义UITextField重写drawTextInRect
方法,但它永远不会被调用。UITextField drawTextInRect永远不会被调用
注意:是的,我已经看到this的答案,但它在10.3上正常工作。
代码示例重现该行为:
#import <UIKit/UIKit.h>
@interface MYCustomTextField : UITextField
@end
@implementation MYCustomTextField
-(void)drawTextInRect:(CGRect)rect {
[super drawTextInRect:rect];
NSLog(@"drawTextInRect calling");
}
@end
我也对苹果的开发者论坛上创建了一个new thread。
可能的重复https://stackoverflow.com/questions/1920783/drawtextinrect-on-uitextfield-not-called – danh
[drawTextInRect on UITextField not called]可能重复(https://stackoverflow.com/questions/1920783)/drawtextinrect-on-uitextfield-not-called) –
我已经说过它可以在iOS 10.3上使用xCode 8正确工作。 –