Skip to content

fix(android): use correct dark/light mode image for Buttons#14458

Open
m1ga wants to merge 1 commit into
mainfrom
androidButtonImage
Open

fix(android): use correct dark/light mode image for Buttons#14458
m1ga wants to merge 1 commit into
mainfrom
androidButtonImage

Conversation

@m1ga
Copy link
Copy Markdown
Contributor

@m1ga m1ga commented Jun 4, 2026

Add an image "test.png" to platform/android/res/drawable/ and platform/android/res/drawable-night/ (classic app)

const window = Ti.UI.createWindow({ backgroundColor: '#fff' });

const btnWithImage = Ti.UI.createButton({
	image: '/images/test.png',
	top: 200, left: 20,
	width: 150, height: 150
});

const imageView = Ti.UI.createImageView({
	image: '/images/test.png',
	top: 200, right: 20,
	width: 150, height: 150
});

window.add([btnWithImage, imageView]);
window.open();

and change dark/light mode using adb shell "cmd uimode night yes" and adb shell "cmd uimode night no"

Bildschirmaufnahme_20260604_155854.webm

Changes:

  • will use the dark/night mode image for the button
  • normal ImageView will also update, even if you don't restart the app (clearing TiImageCache.clear();)

fixes #13467

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.

Android: "Ti.UI.overrideUserInterfaceStyle" does not return night-mode drawables

1 participant