Blu*_*eft 11 listview xamarin xamarin.forms
(我在Xamarin论坛上问过但没有得到回复,所以我在这里尝试)
在Xamarin表单中,BackgroundColorListView中的设置ItemTemplate 会导致触觉反馈被禁用.
有没有办法解决? 我想自定义列表项的颜色,但没有触觉反馈看起来像垃圾.
示例XAML:
<ListView x:Name="list"
ItemTapped="OnItemSelected"
IsGroupingEnabled="True"
GroupDisplayBinding="{Binding Key}"
GroupShortNameBinding="{Binding Key}"
HasUnevenRows="True"
ItemsSource="{Binding .}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout VerticalOptions="FillAndExpand"
Padding="5, 20"
BackgroundColor="#CCCCCC"> <!--This line causes haptic feedback to fail -->
<Label Text="{Binding Name}"
TextColor="Black"
VerticalOptions="Center"
FontSize="Large"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Run Code Online (Sandbox Code Playgroud)
我已经得到最接近的是改变BackgroundColor的ViewCell.Tapped,那么改变它放回View.OnAppearing() (ViewCell.Appearing坏了),但是当手指抬起,而不是当的pressed它改变的背景.
我正在Android上测试,但更喜欢跨平台的解决方案.
| 归档时间: |
|
| 查看次数: |
8353 次 |
| 最近记录: |