日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

xamarin跳转html,Xamarin 页面跳转

發布時間:2023/12/20 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 xamarin跳转html,Xamarin 页面跳转 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

簡介

Xamarin.Forms提供了許多不同的頁面導航體驗,具體取決于所使用的頁面類型

對于ContentPage實例,有兩種導航體驗:

Hierarchical Navigation

Modal Navigation

Hierarchical Navigation

NavigationPage類提供了一種分層導航體驗,用戶可以根據需要在頁面中進行導航,向前和向后導航

該類實現導航作為Page對象的后進先出(LIFO)堆棧

在分層導航中,NavigationPage類用于瀏覽一堆ContentPage對象

要從一個頁面移動到另一個頁面,應用程序會將新頁面推到導航堆棧上,在那里它將成為活動頁面

要返回到上一頁面,應用程序將從導航堆棧中彈出當前頁面,并且新的最頂端頁面將成為活動頁面

根頁面設置為NavigationPage

添加到導航堆棧的第一個頁面被稱為應用程序的根頁面

在App中修改起始頁的設置

MainPage = new NavigationPage(new MainPage());

跳轉頁面

使用Navigation.PushAsync()方法

Button StackLayoutDemo1Button = new Button();

StackLayoutDemo1Button.Clicked += ((sender,e)=>

{

Navigation.PushAsync(new StackLayoutExample());

});

StackLayoutDemo1Button.Text = "StackLayout+Label"; //內容 Content = new StackLayout { //間距 Spacing = 10, Children = { StackLayoutDemo1Button } };

返回上一頁

使用Navigation.PopAsync()方法

var backButton = new Button();

backButton.Text = "返回";

backButton.Clicked += ((sender,e) => { Navigation.PopAsync(); }); //內容 Content = new StackLayout { Spacing = 10, Children = { backButton } };

示例代碼

Modal Navigation

A NavigationPage instance is not required for performing modal page navigation.

執行Modal Navigation不需要NavigationPage的實例

跳轉頁面

使用Navigation.PushModalAsync()方法

StackLayoutDemo1Button.Text = "StackLayout+Label";

Button StackLayoutDemo1Button2 = new Button();

StackLayoutDemo1Button2.Clicked += ((sender,e)=> {

Navigation.PushModalAsync(new ListViewInStackLayout()); }); StackLayoutDemo1Button2.Text = "StackLayout+ListView"; //內容 Content = new StackLayout { //間距 Spacing = 10, Children = { StackLayoutDemo1Button2 } };

返回上一頁

使用Navigation.PopModalAsync()方法

var backButton = new Button();

backButton.Text = "返回";

backButton.Clicked += ((sender, e) => { Navigation.PopModalAsync(); }); Content = new StackLayout { VerticalOptions = LayoutOptions.FillAndExpand, Children = { backButton } };

示例代碼

總結

以上是生活随笔為你收集整理的xamarin跳转html,Xamarin 页面跳转的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。