roubachof / Sharpnado.Tabs

Pure MAUI and Xamarin.Forms Tabs, including fixed tabs, scrollable tabs, bottom tabs, badge, segmented control, custom tabs, button tabs, bendable tabs...
MIT License
507 stars 66 forks source link

[MAUI] BottomTabItem IconImageSource iOS #109

Closed nk-alex closed 5 months ago

nk-alex commented 5 months ago

I moved to MAUI from Xamarin.Forms and I would like to keep on using TabHostView. On my Android project everything has been straightforward so far. But in my iOS project I'm not able to make BottomTabItem show the icon.

I'm using the control like this:


<tabs:TabHostView.Tabs>
    <tabs:BottomTabItem Style="{StaticResource BottomTabStyle}" IconImageSource="central1" Label="1"/>
    <tabs:BottomTabItem Style="{StaticResource BottomTabStyle}" IconImageSource="central2" Label="2"/>
</tabs:TabHostView.Tabs>

On my Android project I put central1.xml and central2.xml under Platforms/drawable/ with AndroidResource build action. Then, on my iOS project I try to do the same as in Xamarin.Forms. I go to Platforms/iOS/Resources and I place central1.png, central1@2x.png and central1@3x,png. But now, I cannot set build action to BundleResources as I would do in Xamarin.Forms.

How I could make BottomTabItem show icon in Maui iOS?

roubachof commented 5 months ago

It's not a sharpnado issue just follow classic maui documentation about displaying an image

nk-alex commented 5 months ago

You are right, just pure MAUI image management. I thought I had to do some platform specific to show icons in iOS.