删除标题视图xamarin形式中的左空格

问题描述 投票:0回答:1

我在标题视图中删除多余的空格时遇到问题,如下please see the screenshot here下图所示

Ps:我正在使用选项卡式页面,而该栏是导航标题视图。

xamarin.forms xamarin.android navigationbar tabbedpage titleview
1个回答
0
投票
在您的Android部分的Toolbar.xml中设置下面的xml。

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

enter image description here

不要忘记在Toolbar.xaml中添加应用程序的名称空间。

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

并检查下面的代码,需要在MainActivity.cs中添加它。 

ToolbarResource = Resource.Layout.Toolbar;

用法:

<NavigationPage.TitleView> <Label Text="Repositories" /> </NavigationPage.TitleView>
enter image description here
© www.soinside.com 2019 - 2024. All rights reserved.