【发布时间】:2021-09-09 19:02:59
【问题描述】:
我有一个ContentPage,上面有一个包含页面标题的导航栏(标题栏)。我希望导航栏在内容(可能是ListView)向上滚动时折叠,并且导航栏必须在内容向下滚动时再次出现(向下滑动)。
请注意,我使用的是FlyoutPage,以前称为MasterDetailPage。
这是我的 XAML 代码
<ContentPage ...
NavigationPage.HasNavigationBar="True"
Title="Home">
<ContentPage.Content>
<ListView VerticalOptions="FillAndExpand" HasUnevenRows="True" CachingStrategy="RecycleElement"
ItemsSource="{Binding ListItems}" SeparatorVisibility="None">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout...>
<Label... />
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage.Content>
</ContentPage>
与此类似:
如何在 Xamarin.Forms 中实现这一点?
【问题讨论】:
标签: c# xaml listview xamarin xamarin.forms