我正在使用Xamarin.Forms和可移植类库构建应用程序。我有一个标签页。我想更改标签页指示器的颜色。更改布局的其余部分是我已经管理的事情,我唯一需要做的就是更改浅蓝色选项卡式页面指示器,如下所示:
我找不到任何可以在 Xamarin.Droid 中工作的东西。这是创建带有内容的选项卡式页面的代码:
class TabbedPageTry : TabbedPage
{
public TabbedPageTry()
{
Title = "TabbedPage";
var myPages = new CategoryDAO().GetCategories();
foreach (var item in myPages)
{
Children.Add(new TabPage(item.CategoryID) { BindingContext = item });
}
}
public class TabPage : ContentPage
{
public TabPage(int categoryID)
{
Padding = new Thickness(0, Device.OnPlatform(20, 0, 0), 0, 0);
var listView = new ListView
{
SeparatorColor = Color.FromHex("#101010"),
ItemsSource = new CourseDAO().GetCourses(),
IsPullToRefreshEnabled = false,
BackgroundColor = Color.White,
};
this.SetBinding(Page.TitleProperty, "Name");
Content = listView;
}
}
因为应用程序正在使用 Xamarin.Forms 制作 Visual Studio,所以我的问题尚未得到解答。我发现的所有问题都是针对 Android 的,这不是我想要的。我需要的是针对我的问题的 C# 解决方案。
先感谢您。