gpt4 book ai didi

xamarin - 更改 Xamarin Forms NavigationPage 工具栏的高度

转载 作者:行者123 更新时间:2023-12-01 01:59:32 29 4
gpt4 key购买 nike

我正在尝试使用 AppCompat 更改在 Android 上呈现的 Xamarin 表单工具栏的高度。表单中没有高度属性来设置它,所以我尝试设置 layout_heighttoolbar.axml如下

<android.support.v7.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="128dp"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways" />

这不会改变高度。

我也试过设置
  • 机器人:最小高度
  • 机器人:高度
  • 高度
  • android:actionBarSize

  • 但那些也不会改变高度。

    FWIW,当将 Xamarin Forms non-AppCompat NavigationPage 与 ActionBar 一起使用时,我能够使用 android:height 设置高度.

    最佳答案

    我发现以下内容对同一问题非常有帮助。

    Xamarin Forms: How to change Toolbar height in Android?

  • 添加 <item name="android:actionBarSize">250dp</item>进入你的styles.xml
  • 删除 android:layout_height="wrap_content"来自 Toolbar.axml。

  • 这应该可以让您定义导航栏所需的任何高度。

    希望有帮助

    关于xamarin - 更改 Xamarin Forms NavigationPage 工具栏的高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37689696/

    29 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com