Tabbedpage 在手机开发中是常用的页面布局方式,但是在IOS平台,与Andriod平台显示效果不一致,在IOS平台中标签位于屏幕下方,而在Andriod平台位于上方,如何保持跨平台的一致性呢,国内大多APP都是在下方显示,这已经成为多数人的习惯。
下面我们上一个DEMO来说明一下:郊果如图
这里大家可以看到列表2上有一块蓝色区域,看起来不怎么舒服,而列表1就好多了,这是因为列表2是一个NavigationPage,而列表1是一个Contentpage.
下面看主要代码,这是一个新建的类,继承于Xamarin.Forms.TabbedPage:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using Xamarin.Forms;
using Xamarin.Forms.PlatformConfiguration;
using Xamarin.Forms.PlatformConfiguration.AndroidSpecific;
namespace APPtest1
{
public partial class tabbedpageDemoPage : Xamarin.Forms.TabbedPage
{
public tabbedpageDemoPage()
{