【问题标题】:How in CarouselPage to divide ContentPage into different files?CarouselPage 中如何将 ContentPage 划分为不同的文件?
【发布时间】:2020-04-26 01:45:37
【问题描述】:

在一个 xaml 文件中,我有一个轮播。从第二部分开始,这里也列出了下一页的代码。为了紧凑,我想在 asp.net 中作为部分应用程序。是否可以将 Contentpage 拆分为每个页面的不同文件以获得更大的便利?谢谢!

  <CarouselPage  xmlns="http://xamarin.com/schemas/2014/forms"
     xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
     xmlns:d="http://xamarin.com/schemas/2014/forms/design">
<ContentPage
    BackgroundImage="background">
   <ContentPage.Content>
    <StackLayout>
    <Image  
        Source="logo">
    </Image>
    <Frame>
        <local:SearchProfile
        Keyboard="Default">
        </local:SearchProfile>
    </Frame>
    <Image 
        Source="starttext">
    </Image>
</StackLayout>
</ContentPage.Content>
</ContentPage>

 <ContentPage>
    <ContentPage.Content>
    <StackLayout>
        <Image Source="map"></Image>
    </StackLayout>
    </ContentPage.Content>
 </ContentPage>

【问题讨论】:

    标签: xamarin xamarin.forms xamarin.android xamarin.ios


    【解决方案1】:

    您不能在一个页面中包含多个页面。一个页面内只能有多个布局。

    CarouselPage 里面不能有 ContentPage,反之亦然。然而 CarouselPage 可以有多种布局(堆栈、相对、绝对、框架、网格)

    这是一个快速的 sn-p 解释 Pages vs Layouts

    【讨论】:

      猜你喜欢
      • 2021-07-09
      • 1970-01-01
      • 2019-11-27
      • 2021-03-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-27
      相关资源
      最近更新 更多