c# - Xamarin 窗体选定的选项卡顶部边框
解决方案
取决于您当前的上下文,但另一种选择是使用Xamarin 社区工具包中的TabView,该功能已经内置并且更多。
与这个问题相关的属性是TabIndicatorPlacement
, TabIndicatorColor
。和TabStripPlacement
<xct:TabView
TabStripPlacement="Bottom"
TabStripBackgroundColor="Blue"
TabStripHeight="60"
TabIndicatorPlacement="Top"
TabIndicatorColor="Yellow"
TabContentBackgroundColor="Yellow">
<xct:TabViewItem
Icon="triangle.png"
Text="Tab 1"
TextColor="White"
TextColorSelected="Yellow"
FontSize="12">
<Grid
BackgroundColor="Gray">
<Label
HorizontalOptions="Center"
VerticalOptions="Center"
Text="TabContent1" />
</Grid>
</xct:TabViewItem>
<xct:TabViewItem
<xct:TabViewItem
Icon="circle.png"
Text="Tab 2"
TextColor="White"
TextColorSelected="Yellow"
FontSize="12">
<Grid>
<Label
HorizontalOptions="Center"
VerticalOptions="Center"
Text="TabContent2" />
</Grid>
</xct:TabViewItem>
</xct:TabView>
编辑
Shell
没有为底部选项卡定义条形指示器(对于顶部选项卡是的),因此您更可能需要使用自定义渲染器(针对每个平台)来完成它,或者甚至自己本地构建它(在每个平台上)。
推荐阅读
- sql - 一次创建多个表
- spring - 表单提交成功后被多次调用
- oauth - 通过 OAuth2 使用 microsoft task api 时遇到问题
- node.js - 如何从 Windows 10 的命令行向我的 socket.io websocket 发送消息?
- javascript - 获取表格组件的行数
- c - 在powershell中将字符串回显到ac程序
- linux - 在 Linux 上获取最大用户态应用程序地址
- javascript - 不理解 Javascript 中的高阶函数。收到错误
- javascript - 如何修复 Linux 上的 npm 安装?
- google-apps-script - 捕获值并发送电子邮件触发器