다음 코드가 생성하는 프레임 스크롤과 유사한 GUI를 만들고 싶습니다.
그러나 이상적으로는 XAML에서 항목 소스로 채워지는 동적 콘텐츠 프레임의 스크롤을 가질 수 있기를 원합니다. 내가 볼 수있는 항목보기를 기반으로 사용자 정의보기를 작성하지 않고는 이것이 가능하지 않다고 생각합니다. ListView 및 CollectionView는 내가 원하는 것을 수행하지 않습니다.
미리보기 CarouselView를 사용해야한다고 생각하는데, 내가없는 일을 할 수있는 방법이 있는지 궁금합니다.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="FlexTest.MainPage">
<ContentPage.Resources>
<Style TargetType="Frame">
<Setter Property="WidthRequest" Value="300"/>
<Setter Property="HeightRequest" Value="500"/>
<Setter Property="Margin" Value="10"/>
<Setter Property="CornerRadius" Value="20"/>
</Style>
</ContentPage.Resources>
<ScrollView Orientation="Both">
<FlexLayout>
<Frame BackgroundColor="Yellow">
<FlexLayout Direction="Column">
<Label Text="Panel 1"/>
<Label Text="A Panel"/>
<Button Text="Click Me"/>
</FlexLayout>
</Frame>
<Frame BackgroundColor="OrangeRed">
<FlexLayout Direction="Column">
<Label Text="Panel 2"/>
<Label Text="Another Panel"/>
<Button Text="Click Me"/>
</FlexLayout>
</Frame>
<Frame BackgroundColor="ForestGreen">
<FlexLayout Direction="Column">
<Label Text="Panel 3"/>
<Label Text="A Third Panel"/>
<Button Text="Click Me"/>
</FlexLayout>
</Frame>
</FlexLayout>
</ScrollView>
</ContentPage>
고마워 앤디.
스크롤 가능한보기를 구현하고 각 하위 항목에 가로로 스크롤 할 수있는 여러 콘텐츠가 포함되어 있습니까?
이 기능의 경우를 표시하려고 CarouselView
A의 ListView
.
코드 확인 :
<ListView ...>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<CarouselView>
<CarouselView.ItemTemplate>
<DataTemplate>
...
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
CarouselView에 대한 자습서 :
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/carouselview/introduction
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다