修改光標的顏色,直接修改tintColor就好了。
[[UITextField appearance] setTintColor:[UIColor blackColor]];
或者直接在XIB上修改,都可以有效。
修改placeholder顏色
self.mobileTF.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.mobileTF.placeholder attributes:@{NSForegroundColorAttributeName:[UIColor redColor]}];