android navigation bar高度,Android 上的 NavigationPage 栏高度

Android 上的 NavigationPage 栏高度NavigationPage Bar Height on Android

07/10/2018

本文内容

此 Android 平台特定的设置上导航栏的高度 NavigationPage 。This Android platform-specific sets the height of the navigation bar on a NavigationPage. 它通过将 NavigationPage.BarHeight 可绑定的属性设置为整数值,在 XAML 中使用:It's consumed in XAML by setting the NavigationPage.BarHeight bindable property to an integer value:

xmlns:android="clr-namespace::::no-loc(Xamarin.Forms):::.PlatformConfiguration.AndroidSpecific.AppCompat;assembly=:::no-loc(Xamarin.Forms):::.Core"

android:NavigationPage.BarHeight="450">

...

此外,还可以使用 Fluent API 从 c # 使用该方法:Alternatively, it can be consumed from C# using the fluent API:

using :::no-loc(Xamarin.Forms):::.PlatformConfiguration;

using :::no-loc(Xamarin.Forms):::.PlatformConfiguration.AndroidSpecific.AppCompat;

...

public class AndroidNavigationPageCS : :::no-loc(Xamarin.Forms):::.NavigationPage

{

public AndroidNavigationPageCS()

{

On().SetBarHeight(450);

}

}

NavigationPage.On方法指定此平台特定的仅在应用程序兼容 Android 上运行。The NavigationPage.On method specifies that this platform-specific will only run on app compat Android. [ NavigationPage.SetBarHeight ] (x: :::no-loc(Xamarin.Forms)::: 。PlatformConfiguration. AndroidSpecific. AppCompat. NavigationPage (:::no-loc(Xamarin.Forms)::: 。IPlatformElementConfiguration { :::no-loc(Xamarin.Forms)::: 。PlatformConfiguration :::no-loc(Xamarin.Forms)::: 。NavigationPage} (在命名空间中)) # A3 方法 :::no-loc(Xamarin.Forms):::.PlatformConfiguration.AndroidSpecific.AppCompat 用于设置上导航栏的高度 NavigationPage 。此外,[ NavigationPage.GetBarHeight ] (x: :::no-loc(Xamarin.Forms)::: 。PlatformConfiguration. AndroidSpecific. AppCompat. NavigationPage (:::no-loc(Xamarin.Forms)::: 。IPlatformElementConfiguration { :::no-loc(Xamarin.Forms)::: 。PlatformConfiguration :::no-loc(Xamarin.Forms)::: 。NavigationPage} ) # A3 方法可用于返回中导航栏的高度 NavigationPage 。In addition, the NavigationPage.GetBarHeight method can be used to return the height of the navigation bar in the NavigationPage.

结果就是可以设置上导航栏的高度 NavigationPage :The result is that the height of the navigation bar on a NavigationPage can be set:

aeff39993222a2f09e4eb3297274bc1e.png

相关链接Related links

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值