この質問はこれら ( 1、2、および3 ) の質問に似ていますが、どの解決策も私の問題を解決しません。
TitleView
問題は同じです。以下に示すの左パディングを削除する必要があります。
Toolbar
次のように定義されたカスタム レイアウトを作成しました。
<androidx.appcompat.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
app:contentInsetStartWithNavigation="0dp"/>
そして、 を呼び出す前に を に設定ToolbarResource
しResource.Layout.Toolbar
ましbase.OnCreate(savedInstanceState);
たMainActivity.cs
。パディングはまだそこにあります。
<NavigationPage.TitleView> ... </NavigationPage.TitleView>
カスタムレイアウトはのナビゲーション バーToolbar
を上書きするのではなく、. を使用しています。Shell
NavigationPage
Shell.TitleView
Shell
のナビゲーションバーからパディングをオーバーライドして削除する方法を知っている人はいますか?