xamarin forms tabbedPage icons in iOS

Jerome Mx 21 Reputation points
2022-10-03T14:40:04.297+00:00

I'm trying to get to grips with TabbedPage, I've added child contentpages
and have included an IconImageSource attribute with the filename as shown below
<ContentPage Title="about" IconImageSource="about.png">

(the icon .png file is. in the resources folder of the ios project)

in the simulator I get tabs but no icons on them..? can someone help here..?

thx,

J.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,301 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 27,126 Reputation points Microsoft Vendor
    2022-10-04T09:05:59.13+00:00

    Hello,

    If the about.png is in the resources folder of the iOS project, you could select the png file and check if its Build Action is BundleResource,then clean the solution and build again.

    And you can check if the image is too large or too small to display properly. It is recommended to follow the guidelines(Tab bars - Navigation and search - Components - Human Interface Guidelines - Design - Apple Developer) to set an appropriate size image. The guide shows @2x or @3x suffixes on the filename, it means two and three times the resolution.

    Or you can add images to an asset catalog image set in the iOS project, and use the assets name to display :

    <ContentPage Title="about" IconImageSource="tabicon">// tabicon is the assets name on myside  
    

    For more details, you can see: Images in Xamarin.Forms - Xamarin | Microsoft Learn

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments