Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Custom item in toolbar

Hello. How i can add custom items in toolbar? I wants add Entry (How in twitter search).
Probably I reviewed all the documentation and all Google, I still did not find anything on this topic. I tried it myself, but I could only add the default items.

Posts

  • ImproveMeImproveMe Member ✭✭✭
    edited February 26

    What you want add?
    So I can give you a example

    is this not working ?
    https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/toolbaritem

    <ContentPage.ToolbarItems>
        <ToolbarItem Text="Example Item"
                     IconImageSource="example_icon.png"
                     Order="Primary"
                     Priority="0" />
    </ContentPage.ToolbarItems>
    
  • DiamondKeshaDiamondKesha Member ✭✭
    edited February 26

    @ImproveMe said:
    What you want add?
    So I can give you a example

    is this not working ?
    https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/toolbaritem

    <ContentPage.ToolbarItems>
        <ToolbarItem Text="Example Item"
                     IconImageSource="example_icon.png"
                     Order="Primary"
                     Priority="0" />
    </ContentPage.ToolbarItems>
    

    I want add Entry or EditText in toolbar.

  • ImproveMeImproveMe Member ✭✭✭
    edited February 26

    Try this.

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage 
    
            // your assemblies and class definition
    
                 NavigationPage.HasNavigationBar="true">
    
        <NavigationPage.TitleView>
            <StackLayout Orientation="Horizontal" Margin="10,10,0,10">
                <Image BackgroundColor="LightBlue" HeightRequest="25" WidthRequest="25"></Image>
                <SearchBar HorizontalOptions="FillAndExpand"></SearchBar>
                <Image BackgroundColor="LightYellow" HeightRequest="25" WidthRequest="25"></Image>
            </StackLayout>
        </NavigationPage.TitleView>
    
        <StackLayout>
            <Image BackgroundColor="LightGray" HorizontalOptions="FillAndExpand" HeightRequest="250"> 
    
            </Image>
            <Label Text="Trends for you">
    
            </Label>
        </StackLayout>
    
    </ContentPage>
    
  • DiamondKeshaDiamondKesha Member ✭✭

    @ImproveMe said:
    Try this.

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage 
    
          // your assemblies and class definition
    
                 NavigationPage.HasNavigationBar="true">
    
        <NavigationPage.TitleView>
            <StackLayout Orientation="Horizontal" Margin="10,10,0,10">
                <Image BackgroundColor="LightBlue" HeightRequest="25" WidthRequest="25"></Image>
                <SearchBar HorizontalOptions="FillAndExpand"></SearchBar>
                <Image BackgroundColor="LightYellow" HeightRequest="25" WidthRequest="25"></Image>
            </StackLayout>
        </NavigationPage.TitleView>
    
        <StackLayout>
            <Image BackgroundColor="LightGray" HorizontalOptions="FillAndExpand" HeightRequest="250"> 
                
            </Image>
            <Label Text="Trends for you">
                
            </Label>
        </StackLayout>
    
    </ContentPage>
    

    Yes, it work, thank.

Sign In or Register to comment.