0

Web ページをタブ付きページとして表示する方法はありますか? タブ付きページには 2 つのタブがあります。1 つは about 用、もう 1 つは contact 用です。タブ付きページのコンテンツを「www.example.com/about」や「www.example.com/contact」のような単なる URL として配置することは可能ですか? 現在、タブ付きページにブラウザを開くボタンがあります。以下のコード:

  public AboutPage()
    {
        InitializeComponent();
        this.Title = "About";


        StackLayout contact = new StackLayout
        {
            VerticalOptions = LayoutOptions.Center,
            Children = {
            new Label {
                HorizontalTextAlignment=TextAlignment.Center,
                Text = "contact here"
            }
            }
        };
        var browser = new WebView();
        var htmlSource = new HtmlWebViewSource();
        htmlSource.BaseUrl = "http://www.google.com";
        browser.Source = htmlSource;
        Button abtbutton = new Button
        {
            Text = "View about page"
        };
        abtbutton.Clicked += OnAboutBtnClicked;
        this.Children.Add(new ContentPage
        {
            Title = "About",
            Content = browser
        }
        );
        this.Children.Add(new ContentPage
        {
            Title = "Contact",
            Content = contact
        });
    }

    void OnAboutBtnClicked(object sender, EventArgs args)
    {
        Device.OpenUri(new Uri("http://www.google.com"));
    }
4

1 に答える 1