-
I'm generating my TabGroup icons from a font at app start with: // generate icons
function generateIcon(icon) {
var size = (icon.size == undefined) ? 30 : icon.size;
var f = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, icon.filename);
var lbl = Ti.UI.createLabel({
text: icon.icon,
font: {
fontSize: size - 2,
fontFamily: "remixicon"
},
color: "#888"
});
var view = Ti.UI.createView({
width: size,
height: size,
});
view.add(lbl);
var img = view.toImage();
f.write(img);
}
generateIcon({
filename: 'icon_list.png',
icon: "\uEEBA"
})
generateIcon({
filename: 'icon_user.png',
icon: "\uF264"
}) and then setting the icons $.tab1.icon = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'icon_list.png').read();
$.tab2.icon = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'icon_user.png').read(); it is working fine on Android: but my iOS icons are way to big: Also tried to generate the generateIcon({
filename: '[email protected]',
icon: "\uEEBA",
size: 90 // 60
}); but didn't change anything. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
After analyzing the generated images it looks like: if (OS_IOS) {
size /= Ti.Platform.DisplayCaps.logicalDensityFactor;
} fixes the issue 🤷♂️ |
Beta Was this translation helpful? Give feedback.
-
I've never tried this aproach of setting tab icons, but I guess including the |
Beta Was this translation helpful? Give feedback.
-
I generate the icons on thy fly
|
Beta Was this translation helpful? Give feedback.
After analyzing the generated images it looks like:
fixes the issue 🤷♂️