25 lines
697 B
Objective-C
25 lines
697 B
Objective-C
//
|
|
// DSTextField.m
|
|
// DSChat
|
|
//
|
|
// Created by DSKJ on 2022/6/15.
|
|
// Copyright © 2022 DS. All rights reserved.
|
|
//
|
|
|
|
#import "DSTextField.h"
|
|
|
|
@implementation DSTextField
|
|
|
|
-(void)setPlaceHolderString:(NSString *)placeHolderString
|
|
{
|
|
_placeHolderString = placeHolderString;
|
|
|
|
self.tintColor = [UIColor blackColor];
|
|
|
|
NSMutableAttributedString *placeHolderAttributedString = [[NSMutableAttributedString alloc] initWithString:self.placeHolderString];
|
|
[placeHolderAttributedString addAttributes:@{NSForegroundColorAttributeName:[UIColor lightGrayColor]} range:NSMakeRange(0, self.placeHolderString.length)];
|
|
self.attributedPlaceholder = placeHolderAttributedString;
|
|
}
|
|
|
|
@end
|