locked
Title icon of page is not showing RRS feed

  • Question

  • User355323 posted

    Title icon of a page is not showing in android, how can i resolve it please help.

    Friday, May 3, 2019 11:29 AM

Answers

  • User382871 posted

    @Ajay87
    Create a TitleView to display the image in Navigation Bar. Tutorial: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/navigation/hierarchical#displaying-views-in-the-navigation-bar ```

    <ContentPage.Content>
        <StackLayout>
    
        </StackLayout>
    </ContentPage.Content>
    

    ```

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, May 10, 2019 8:46 AM

All replies

  • User187007 posted

    If you are using prism with Mvvm this is how it will be

                        var param = new NavigationParameters();
    
                        param.Add("Icon", "homeIcon");
                        param.Add("Title", "Home Page");
                        param.Add("Pagename", nameof(HomePage));
                        await _navigationServices.NavigateAsync("/MenuPage/NavigationPage/HomePage", param);
    
    Friday, May 3, 2019 12:33 PM
  • User355323 posted

    @BASHA
    Thanks for reply, let me try

    Friday, May 3, 2019 12:41 PM
  • User382871 posted

    @Ajay87 You can add the icon in App.Android Toolbar.axml. ```

    <ImageView 
        android:src="@drawable/gri_d"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>
    

    ``` Refer to https://stackoverflow.com/a/40098078/11083277

    Friday, May 3, 2019 1:10 PM
  • User355323 posted

    @yelinzh , Hi yelinzh, actually i need to do in xamarin forms not in native platforms.

    Thanks 4 reply

    Friday, May 3, 2019 1:12 PM
  • User72117 posted

    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml x:Class="MenuDrawerPage" ** Icon="Bars32.png"** BackgroundColor="#0057a5" Padding="0,40,0,0"

    Like that? @Ajay87

    Friday, May 3, 2019 2:08 PM
  • User355323 posted

    @nick5454 Hi nick, yes i tried, but its not working

    Wednesday, May 8, 2019 10:15 AM
  • User72117 posted

    @Ajay87 Can you post your markup. Is this a master-detail, tabbed, single? Is this on the second page and if so and you have a Navigation page then like the answer above said, you would need a custom renderer.

    Wednesday, May 8, 2019 1:03 PM
  • User382871 posted

    @Ajay87
    Create a TitleView to display the image in Navigation Bar. Tutorial: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/navigation/hierarchical#displaying-views-in-the-navigation-bar ```

    <ContentPage.Content>
        <StackLayout>
    
        </StackLayout>
    </ContentPage.Content>
    

    ```

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, May 10, 2019 8:46 AM
  • User355323 posted

    @yelinzh
    Hi yelinzh, Its working Thanks

    Friday, May 10, 2019 10:30 AM