Skip to content

fix(android): backgroundColor in TextField #14222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented May 6, 2025

The Material library was updted from 1.6.2 to 1.12.0 recently. In 1.7.0 there was a new "Shape theming" added (more info). This change added a new drawable that is not removed when trying to set a background color. According to these attributes we should change boxBackgroundColor to set the color.

var win = Ti.UI.createWindow();
var view = Ti.UI.createView({
	backgroundColor: "#666",
	width: 200,
	height: Ti.UI.SIZE,

})
var tf = Ti.UI.createTextField({
	width: 100,
	// borderStyle: Titanium.UI.INPUT_BORDERSTYLE_NONE,  // better way to do it
	backgroundColor: "red",
});
setTimeout(function() {
	tf.backgroundColor = "blue"
}, 2000)
view.add(tf);
win.add(view);
win.open();

Textfield will have a red and blue background (after 2 sec).

  • added a test file
  • tested in Android 10, Android 15, iOS

fixes #14223

@m1ga m1ga marked this pull request as ready for review May 9, 2025 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong TextField and TextArea Background color in 12.7.0
2 participants