Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

TabbedPage Icons not visible (Android)

$
0
0

Hi, I want to add Icons to my TabbedPage (see image ) but the icons don't get displayed on Android Devices:

Here's my sample code of my shared projects GetMainPage method:

`public static Page GetMainPage()
{
// First Tab
ContentPage tab1 = new ContentPage{

            Icon = "icon_home.png",
            Content = new StackLayout
            {
                Children = {
                    new Label{
                        Text = "TAB 1"
                    },
                }
            }
        };


        // Second Tab
        ContentPage tab2 = new ContentPage{

            Icon = "icon_info.png",
            Content = new StackLayout
            {
                Children = {
                    new Label{
                        Text = "TAB 2"
                    },
                }
            }
        };



        var navi = new NavigationPage(new TabbedPage
        {
            Children = { tab1, tab2,}
        }
            )
        {
            Tint = Colors.Red.ToFormsColor()
        };
        return navi;
    }`

I added the images to the "Resources.drawable" folder of my android project. Thank you in advance.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>