anpin/ContextMenuContainer

[Enhancement] IconSize Property

Closed this issue ยท 8 comments

Summary

the icon size on iOS is really good but
as you can see the android version doesn't have text when an item has icon.
and size of the icon on macOS and UWP and Android is not looking good.

Screenshot

Screenshot (1222)
Screenshot (1224)

anpin commented

Hi @mhrastegary77 thanks for your interest and feedback! This is still pretty much in beta and I'm sorry you got such a result. I should say it worked for my case with the icons, but I had them only in menus with a single row. Which size of the icon did you used on UWP?

Hi Pavel first of all you have a really nice work here i love this package!!!
and i used a shared 513*513 image with ResizetizerNT on all of my platforms.

anpin commented

I think it could be a problem with the ResizetizerNT as I'm testing it with SVG or pre rendered PNGs for all DPI and it looks fine. Looking at the ResizetizerNT docs it seems that you have to specify size request for the XF Image in order for it to work, but I don't use XF image for icons here, it is handled directly in the platform implementation (so you just bind FileImageSource, not the actual Image). I guess as a workaround you can try to specify a native Image using same asset somewhere outside of ContextMenuItem, so ResizetizerNT will handle it properly.

Hmm yeah you were right!!! Once I set a baseSize like 20 for my images it looks fine on UWP and Android now too but still on the Android only the first item has icon and others doesn't have any.

anpin commented

Can you post a sample of how you reference icons? On screenshots in the first post I can see icons only on the first item for all four platforms

in the screenshot it is one icon! And in one of my projects I just seeing Android doesn't have the second icon but others like iOS and UWP are fine

image

anpin commented

In the provided sample it has multiple icons on Android. If you can post a repro where it doesn't show multiple icons on Android I can further investigate it. Otherwise I suggest you check that your icons have proper names on Android and they are located in the drawable folder.

yup! you were right my icons should be located in the drawable folder cant't use shared image on android, it's fixed thanks.