【发布时间】:2018-03-15 10:09:21
【问题描述】:
所以我将 Xamarin 表单用于跨平台应用程序,主 UI 是一个选项卡式页面,其中一个页面中有一个 segmented control,段控件将切换列表视图控件的数据。问题是当我滑动屏幕时,它会在选项卡式页面的不同子页面之间切换,但我希望它在子页面内的段控件之间切换。无论如何我可以让滑动不适用于标签页,但内部段控件?
标签页的 XAML:
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MainApp"
x:Class="MainApp.MainPage">
<!--Pages can be added as references or inline-->
<local:NewsPage Title="News" Icon="icon.png"/>
<ContentPage Title="Guides" Icon="icon.png"/>
<ContentPage Title="Wallets" Icon="icon.png"/>
<ContentPage Title="Me" Icon="icon.png"/>
</TabbedPage>
新闻页面:
<controls:SegmentedControl x:Name="SegControl" TintColor="#007AFF" SelectedSegment="0"
VerticalOptions="Center"
Grid.Column="1" ValueChanged="SegControl_ValueChanged">
<controls:SegmentedControl.Children>
<controls:SegmentedControlOption Text="Type1" />
<controls:SegmentedControlOption Text="Type2" />
</controls:SegmentedControl.Children>
</controls:SegmentedControl>
<ListView ItemsSource="{Binding Source={StaticResource SArray}}" Grid.Row="1" Grid.Column="0" RowHeight="85">
<ListView.ItemTemplate> ... </ListView>
【问题讨论】:
标签: android xamarin xamarin.forms swipe uisegmentedcontrol