0

Image:

Image

I would like to add a frame to toolbar in Xamarin forms. But toolbar is not accepting.

ThanhPhanLe
  • 1,315
  • 3
  • 14
  • 25

1 Answers1

0

You cannot add a frame as a Toolbar Item.

You can use, for example the TitleView and customize the whole NavigationView yourself.

For example:

 <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:TitleViewSample"
             x:Class="TitleViewSample.MainPage">

<NavigationPage.TitleView>
        <StackLayout Orientation="Horizontal">
             <Label Text="Hello World" HorizontalOptions="Center"/>
            <Frame BackgroundColor="Yellow" HorizontalOptions="End"/>
        </StackLayout>
    </NavigationPage.TitleView>

</ContentPage>
Bruno Caceiro
  • 7,035
  • 1
  • 26
  • 45
  • But I am having a badge control in toolbar which should work only if it is toolbar item. I need to display my image which is in a circular frame and the color the frame changes dynamically and it should be aligned to the right of badge control. – Ravi Kiran Palanchu Aug 24 '19 at 08:19