Forum Xamarin.Forms

Shell.TitleView: Left aligned image not fully left aligned.

Overdrive77Overdrive77 Member ✭✭
edited April 2 in Xamarin.Forms

I'm creating a custom TitleView using Shell and added an Image to the layout. When the application runs (In Android), there's a space between the sidenav button and the custom icon Image. I'm using Xamarin.Forms v4.4.0.991757 (for various reasons I'm unable to upgrade to a later version)

How do I place the Image flush against the sidenav button?

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             AbsoluteLayout.LayoutFlags="All"
             AbsoluteLayout.LayoutBounds="0,0,1,1"
             mc:Ignorable="d"
             xmlns:sx="clr-namespace:MyProject"
             x:Class="MyProject.MainPage">

    <Shell.TitleView>
        <StackLayout Orientation="Horizontal" Spacing="0">
            <Image x:Name="navImage" WidthRequest="28" HeightRequest="28" HorizontalOptions="Start"></Image>
        </StackLayout>
    </Shell.TitleView>
</ContentPage>

Best Answer

Answers

  • Overdrive77Overdrive77 Member ✭✭

    Thanks ColeX!

    It's a shame we need to create a custom renderer for a small tweak like that? I think for now I'm just gonna live with 'The Gap' or if requested I'll try a different layout approach.

Sign In or Register to comment.