Xamarin使用xaml视图和;动态内容
在Xamarin.Forms中,如何获得包含一些xaml视图和动态列表的滚动视图页面 这是我想要的样品Xamarin使用xaml视图和;动态内容,xamarin,xamarin.forms,Xamarin,Xamarin.forms,在Xamarin.Forms中,如何获得包含一些xaml视图和动态列表的滚动视图页面 这是我想要的样品 <ScrollView Orientation="Vertical"> <!-- TO MAKE WHOLE PAGE SCROLLABLE --> <StackLayout Orientation="Vertical"> <!-- SOME XAML
<ScrollView Orientation="Vertical"> <!-- TO MAKE WHOLE PAGE SCROLLABLE -->
<StackLayout Orientation="Vertical">
<!-- SOME XAML VIEWS HERE-->
<Frame Margin="8">
###############
</Frame>
<StackLayout Orientation="Vertical">
################
<!-- A DYNAMIC LIST HERE Just like ListView but with dynamic data and without scroll,
just like linear layout in android-->
</StackLayout>
</StackLayout>
</ScrollView>
###############
################
您可以使用来实现这一点
通过将bindableayout.ItemTemplate
附加属性设置为DataTemplate
,可以定义可绑定布局中每个项目的外观:
<ScrollView>
...
<StackLayout x:Name="MyStackLayout" Orientation="Vertical">
<BindableLayout.ItemTemplate>
<DataTemplate>
<StackLayout Orientation="Horizontal" BackgroundColor="GreenYellow">
...
<Label Text="{Binding Name}"/>
...
</StackLayout>
</DataTemplate>
</BindableLayout.ItemTemplate>
</StackLayout>
...
</ScrollView>
...
...
...
...
其效果是: