c# - 如何在状态栏和导航栏(Xamarin Forms)之间添加横幅
问题描述
目前我正在尝试在状态栏和导航栏之间添加离线横幅。
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="OfflineBannerDemo.BasePage"
x:Name="basePageCodeBehind">
<ContentPage.Content>
<Grid>
<!-- MainContent -->
<ContentView x:Name="MainContentView"
BackgroundColor="Blue"
Content="{Binding Source={x:Reference basePageCodeBehind}, Path=MainContent}" />
<!-- ConnectivityView -->
<Grid x:Name="connectivityGrid"
VerticalOptions="Start"
Opacity="0"
InputTransparent="True"
BackgroundColor="Red"
HeightRequest="25">
<Label Text="Offline"
VerticalOptions="Center"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Center"
FontSize="Small"
TextColor="White"
/>
</Grid>
</Grid>
</ContentPage.Content>
</ContentPage>
使用关于代码我设法将其显示在导航栏下方,如下所示
如果无论如何要在状态栏和导航栏之间添加它,请告诉我。
谢谢你。
解决方案
推荐阅读
- c# - 如何在 C# 中使用 linq 动态添加列表中的多个项目
- php - 两张桌子并排
- angular - Angular 8:从本地存储读取,修改并保存回同一个文件
- c# - 保存的搜索以编程方式不返回任何结果
- powerbi - 与外部用户共享工作区、报告和应用程序
- node.js - 如何在nodejs中返回一个带有“for”循环和异步的数组?
- r - 具有不同的 .RMD 文件和输出文件名
- github - 我们如何在 GitHub Pull Request Builder 插件上禁用此“管理员可以验证此补丁吗?”?
- visual-studio - Visual Basics - 解决方案未加载
- python - 在按一次向上箭头键后,我创建的角色不会回到确切的平台