Device differences
I understand that each device has their own set of UI components.
Setting something like the background image on a window should be universal though, right? And what is up with the button on the droid?
4 Answers
-
Without seeing your code, I'm not sure why you're not getting the background image on Android. It's certainly supported. I've set background images on a couple of my apps. The platforms stretch button images differently, which is what you're seeing with the button. iOS seems to cut out and expand the middle portion, leaving the edges with the same shape as the original. Pretty cool. Android just stretches the whole thing, creating the ugly weirdness you're seeing.
iOS doesn't support button background colors, though Android does. You could use the stock buttons, create full-size (non-stretched) button background graphics, or code platform-specific solutions.
-
Tim / Ronnie,
Actually, Android does support intelligent stretching of images. It just does it in a different manner than iOS. And at least in 1.4.x, support for it is limited to buttons and labels.
However, you can get button images to stretch nicely in Android provided you create a "9 patch" image which conveys to Android how it should stretch the image.
As it so happens, I was just trying to fix this problem myself today and Hal kindly pointed me in the right direction. See his response in this thread:
http://developer.appcelerator.com/question/83791/do-backgroundleftcap-and-backgroundtopcap-work-on-android-buttons
-
thanks for the info on the buttons. Does that means I hae use different images for the iphone and android?
Regarding the background image, I just realized I am using tabGroup.backgroundImage rather than window.backgroundImage
Is that only supported by iphone?
-
Yes, I now use different images for android vs iphone so the 1-pixel border on the android 9 patch images does not show up as partial black lines under iOS. But the good news is Titanium will bundle in the correct image at build time if you put them in the iphone and android subfolders of Resources.
I don't know about your background image question.