gpt4 book ai didi

c# - 在哪里可以找到 TabbedPage 的 ToolbarPlacement 属性?

转载 作者:行者123 更新时间:2023-11-29 23:26:06 26 4
gpt4 key购买 nike

我试图在 android 中找到屏幕底部的 Tabbing 栏,我已经在后面的 C# 代码中找到了,但我只是想知道如何在 .xaml 代码中做到这一点?

我已经添加了 Xamarin.Forms.PlatformConfiguration.AndroidSpecific 命名空间,但找不到 ToolbarPlacement 属性来将其设置为 "Bottom"如下图所示。

enter image description here

那么有没有办法在xaml代码中设置呢?

最佳答案

工具栏放置

可以在特定平台的底部获取这些选项卡:

在 XAML 代码上:

<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
android:TabbedPage.ToolbarPlacement="Bottom" >

蓝线表示找不到ToolbarPlacement 或其他。这是一个智能感知问题,因为它们不是属性,而是真正的建设性论据。 别担心,它们效果很好!

或者在后面的 C# 代码中:

using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;

On<Xamarin.Forms.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);

您还可以使用这些属性来自定义底部的栏

BarBackgroundColor="#2196F3"
android:TabbedPage.BarItemColor="Wihte"
android:TabbedPage.BarSelectedItemColor="#66FFFFFF"
BarTextColor="White"

关于c# - 在哪里可以找到 TabbedPage 的 ToolbarPlacement 属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53542231/

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