[TextInput] Tint color for cursor and clearButton
Could these props be added?
Would be nice to be able to change the cursor from something other than the blue. And as for the clear button, it's not visible on a black background TextInput.
tintColor: probably makes sense to expose this to all Views. Perhaps the property should be named tintColorIOS... I don't have enough context on the Android side of things to tell you what the right choice is here.
clearButton color: iOS doesn't provide a way to customize the clearButton's look AFAIK so you should build your own if you want to style it differently... one common theme amongst a lot of UIKit APIs is that if you stray away from the confines of the API author's intents (e.g. changing a text field's white background -> black background) then you need to rebuild several components from the ground up.
You're right about the clear button - apologies for not looking into that first. UITextField's do have a rightView that can be set to a custom UIButton, but at that point it's probably easier to build a new react component.
Cursor tintColor should definitely be possible though!
+1 tintColor
+1 tintColor
I think it's possible on Android using textCursorDrawable.
For iOS, you can set tint color by adding the following line to AppDelegate.m > didFinishLaunchingWithOptions
self.window.tintColor = [UIColor redColor];
or like this
[[UITextField appearance] setTintColor:[UIColor whiteColor]];
I think it's really important to have tintColor accessible across all UIView, how can we do it?
+1 tintColor
+1 tintColor
+1
Looks like this works on iOS now with the selectionColor prop (but not on Android). We have #2555 working on the clear button tint color for iOS. Android doesn't have a clear button.
You could do this globally for Android. Just pimp your styles.xml in android like this:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<!-- sets cursor color -->
<item name="colorControlActivated">@android:color/white</item>
</style>
</resources>
It looks like, when considered as a bug there are workarounds listed here so this is kind of dealt with. I'm sure we could make this better though. I am going to close this issue, but if people would like better tint color support then I encourage folks to create/upvote a feature request on Product Pains. https://productpains.com/product/react-native?query=tint