【发布时间】:2018-07-31 06:30:43
【问题描述】:
我正在处理Xamarin.Forms。我的 android 项目中有 底部标签。选项卡显示默认背景颜色为浅灰色。我需要将标签背景颜色更改为我喜欢的颜色。但我不能这样做。
我正在使用下面的代码
MainPage.xaml 文件
<?xml version="1.0" encoding="utf-8"?>
<MyTabbedPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:edTheSIS"
x:Class="edTheSIS.ParentDashboard">
<local:DairyTabPage Icon="icon1"></local:DairyTabPage>
<local:MykidTabPage Icon="icon2" ></local:MykidTab>
<local:EventsPage Icon="icon3"></local:Events>
<local:AboutPage Icon="icon4"></local:About>
</MyTabbedPage>
MyTabbedPage.cs 文件
public class MyTabbedPage : Xamarin.Forms.TabbedPage
{
public MyTabbedPage()
{
On<Xamarin.Forms.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom);
}
}
输出我得到截图:
【问题讨论】:
标签: c# xamarin xamarin.forms tabs