How to create a tablet UI with multiple ContentPages on one screen at the same time with Xamarin.Forms?

前端 未结 2 1696
梦毁少年i
梦毁少年i 2021-01-20 20:35

I want to design a UI for tablets (Android & iOS) with Xamarin.Forms where I want to have multiple ContentPages

2条回答
  •  遇见更好的自我
    2021-01-20 21:01

    As far as I know you can't put multiple ContentPage items on the screen, at least not within the out-of-the-box Xamarin.Forms.

    You can, however, put multiple ContentView items on the screen and you can reuse the ContentView items in stand-alone pages as well.

    Essentially you can describe what you'd want to see on a single page as a ContentView and then make a page that just includes that

    PhotoItem.xaml:

    
       
         
       
    
    

    PhotoBucket.xaml:

    
      
        
         
           
              ... on list item tap do Navigation.PushAsync(new PhotoItemPage{BindingContext = itemTapped} );
           
          
         
            // Add two columns
             
                ... on list item tap do PhotoItem.BindingContext = itemTapped
             
             
          
        
       
    
    

    PhotoItemPage.xaml:

    
       
    
    

提交回复
热议问题