1

この質問はこれら ( 12、および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"/>

そして、 を呼び出す前に を に設定ToolbarResourceResource.Layout.Toolbarましbase.OnCreate(savedInstanceState);MainActivity.cs。パディングはまだそこにあります。

<NavigationPage.TitleView> ... </NavigationPage.TitleView>

カスタムレイアウトはのナビゲーション バーToolbarを上書きするのではなく、. を使用しています。ShellNavigationPageShell.TitleView

Shellのナビゲーションバーからパディングをオーバーライドして削除する方法を知っている人はいますか?

4

1 に答える 1