Question

Currently i try to fix my blurred icons in the android version of my titanium project. I read a lot of docs and know that there's a best-practice directory-structure for the different android resolutions. unfortunatly i can't get it to work so far, so any help would be appreciated. I'm using Titanium SDK 3.1.2

I reference my icons something like this:

var searchButton = Ti.UI.createButton({
image: "/images/icons/xyz.png",
});

My assets are in: /Resources/android/images/icons.. /Resources/iphone/images/icons..

So anyone can tell me how to use the right icon for the right resolution in android of the icon.pngs?

App-Icons are not a problem problem. These i've got in different versions in

/platforms/android/res/drawable-hdpi/
/platforms/android/res/drawable-ldpi/
/platforms/android/res/drawable-mdpi/

Splashscreens are not a problem. These i've got in different versions in

/Resources/android/images/res-long-land-hdpi/
/Resources/android/images/res-long-land-ldpi/
/Resources/android/images/res-long-port-hdpi/
/Resources/android/images/res-long-port-ldpi/
/Resources/android/images/res-notlong-land-hdpi/
/Resources/android/images/res-notlong-land-ldpi/
/Resources/android/images/res-notlong-land-mdpi/
/Resources/android/images/res-notlong-port-hdpi/
/Resources/android/images/res-notlong-port-ldpi/
/Resources/android/images/res-notlong-port-mdpi/

Thanks in advance!

Était-ce utile?

La solution

For me, each icon's density specific version goes in the following folders:

/Resources/android/images/res-ldpi/icon.png
/Resources/android/images/res-mdpi/icon.png
/Resources/android/images/res-hdpi/icon.png
/Resources/android/images/res-xhdpi/icon.png
/Resources/android/images/res-xxhdpi/icon.png
/Resources/android/images/res-xxxhdpi/icon.png
/Resources/iphone/images/icon.png
/Resources/iphone/images/icon@2x.png

And then I reference it in .js:

var myImage = Ti.UI.createImage({
    image: '/images/icon.png',
});
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top