天天看點

UITextField屬性--PlaceHolder顔色自定義

//設定placeHolder的顔色

    UIColor *color = [UIColor colorWithRed:168/255.0 green:166/255.0 blue:42/255.0 alpha:1.0];

    self.endAddressText.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"請輸入目的地" attributes:@{NSForegroundColorAttributeName: color}];