.h
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SelfTextField : UITextField
@end
NS_ASSUME_NONNULL_END
.m
#import "SelfTextField.h"
#import "CommonUI.h"
@interface SelfTextField ()
@end
@implementation SelfTextField
- (void)drawRect:(CGRect)rect
{
CGSize size = [CommonUI screenDp];
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor);
CGContextFillRect(context, CGRectMake(0, CGRectGetHeight(self.frame) - 1, CGRectGetWidth(self.frame), 1));
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end