Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

xamarin.forms - Remove left space in title view xamarin forms

I had an issue in removing the extra left space in title view as shown in the image below please see the screenshot here

Ps: I'm using tabbed page and that bar is the navigation title view.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Set the xml below in your Toolbar.xml of Android part.

app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp" 

enter image description here

Do not forget to add the namespace of app in your Toolbar.xaml.

xmlns:app="http://schemas.android.com/apk/res-auto"

And check the code below, it need to be added in MainActivity.cs.

ToolbarResource = Resource.Layout.Toolbar;

Usage:

<NavigationPage.TitleView>
    <Label Text="Repositories" />
</NavigationPage.TitleView>

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...