Titanium UiTextField Clear button is not at all visible in Dark Mode for iOS v13

393 views Asked by At

I have been facing an issue with clearButtonMode property of UiTextField in my input box. If I use app in light mode then everything work well but the moment I switched to dark mode that clear button is not at all visible in input box.

So, Just want to know is it Possible to add backgroundColor to that button for dark mode? Or is there any possibilities to make it visible in Dark Mode.

I have attached the code and screenshot of my problem.

Here is text Field code.

 var checkField = Ti.UI.createTextField({
    width: Ti.UI.FILL,
    height: 30,
    top: 10,
    left: 10,
    right: 10,
    color: '#000000',
    backgroundColor: 'white',
    tintColor: '#000000',
    borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
    returnKeyType: Ti.UI.RETURNKEY_DONE,
    clearButtonMode: Titanium.UI.INPUT_BUTTONMODE_ALWAYS,
});

Screenshot: enter image description here

Thanks in Advance!!!

1

There are 1 answers

1
miga On BEST ANSWER

it looks like it is a very light grey (when you set it to a dark backgroundColor you'll see the X again. But it looks like it is native behavior: https://developer.apple.com/forums/thread/124973 and you'll need to create a custom textfield image (https://stackoverflow.com/a/10274246/5193915) but that means inside the SDK.

As a quick workaround I would just create an image and place it on top of the TextField and move it to the right corner.