VB.NET, C#, PowerShellを使用しているエンジニアのためのサイト。
基本的な使用方法から開発で役立つTipsまで幅広く取り扱っています。
Update 2018/08/28
TabbedPageを使用すると、1つのページをタブで複数に分けることが出来ます。
TabbedPageを実装するページのコードビハインドは、以下のようにTabbedPageクラスを継承する必要があります。
namespace TabbedPageSample
{
public partial class MainPage : TabbedPage
{
public MainPage()
{
InitializeComponent();
}
}
}
次に、タブページの実装をします。
MainPage.xamlファイルを開いたら、TabbedPageの中に必要な分だけContentPage を配置します。
以下の例では3つのContentPageを配置して言いますので、3つのタブが作成されます。
<?xml version="1.0" encoding="utf-8"?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:TabbedPageSample"
x:Class="TabbedPageSample.MainPage">
<ContentPage Title="タブ1">
<Label Text="1ページ" VerticalOptions="Center" HorizontalOptions="Center" />
</ContentPage>
<ContentPage Title="タブ2">
<Label Text="2ページ" VerticalOptions="Center" HorizontalOptions="Center" />
</ContentPage>
<ContentPage Title="タブ3">
<Label Text="3ページ" VerticalOptions="Center" HorizontalOptions="Center" />
</ContentPage>
</TabbedPage>
実行例を以下に示します。