使用xamarin.forms在ios项目中创建的close pagerenderer

时间:2016-04-21 15:18:55

标签: c# xamarin xamarin.ios

我使用以下步骤创建了页面的PageRenderer:

  1. 我在PCL项目中创建了一个页面,其中没有声明任何内容。
  2. 根据我的需要创建了一个PageRenderer并声明了元素。我用过await Navigation.PushAsync(new MyPage(),true);打开它。
  3. 完成所需操作后,我想关闭此页面并返回上一页。
  4. 请建议我如何做到这一点。提前谢谢。

2 个答案:

答案 0 :(得分:1)

离开页面,使用use double loop to store each P2 closest to P1 example: array [P1][P2] Sort array based on size of array [P1].numOfElements () such that largest is at the top now remove top element P from set S and in array P1 and all subsequent P in P2 of all P1 If P2 is empty for any element X in P1 then remove it Remove the next top element and do the process again until array is empty Resulting set is the answer for minimum points

答案 1 :(得分:1)

PushAsync返回后的某个地方,您将致电PopAsync以删除该页面

Xamarin.Forms.NavigationPage Class

var newPage = new ContentPage ();
await Navigation.PushAsync (newPage);
Debug.WriteLine ("the new page is now showing");
var poppedPage = await Navigation.PopAsync ();
Debug.WriteLine ("the new page is dismissed");