Xamarin.Forms ListView 不高亮选中项?
Xamarin.Forms ListView does not highlight selected item?
尝试在 Xamarin.Forms 和 iOS 上启动一个新项目 13 我的 ListView 上没有显示任何突出显示。使用 Visual Studio 作为 Mac 开箱即用的 "Blank Forms App" 解决方案,我将 MainPage.xaml 上的内容更改为:
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="ListViewTest.MainPage">
<StackLayout>
<ListView SelectionMode="Single">
<ListView.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>mono</x:String>
<x:String>monodroid</x:String>
<x:String>monotouch</x:String>
<x:String>monorail</x:String>
<x:String>monodevelop</x:String>
<x:String>monotone</x:String>
<x:String>monopoly</x:String>
<x:String>monomodal</x:String>
<x:String>mononucleosis</x:String>
</x:Array>
</ListView.ItemsSource>
</ListView>
</StackLayout>
选择"monotouch"时,视图看起来像下面的图像,无论是在模拟器还是在设备上。我本以为 "monotouch" 行会出现灰色选择栏,但它只修改了行边框。
这是 Xamarin.Forms 4.3.0.908675(截至该日期的最新版本)。我尝试回滚到 Forms 4.0 和 3.6 并在两者上看到相同的结果,这使得它看起来像是 iOS 13?
中的新内容
我尝试搜索有此问题的其他人,但只找到有关更改或隐藏突出显示颜色的文章;我只是想匹配系统行为。
还有其他人碰到过这个吗?有任何想法吗?谢谢!
新版本修复了这个错误
Wednesday, October 30, 2019 - Xamarin.Forms 4.3.0.947036 (4.3.0
Service Release 1)
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/release-notes/4.3/4.3.0-sr1
尝试在 Xamarin.Forms 和 iOS 上启动一个新项目 13 我的 ListView 上没有显示任何突出显示。使用 Visual Studio 作为 Mac 开箱即用的 "Blank Forms App" 解决方案,我将 MainPage.xaml 上的内容更改为:
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="ListViewTest.MainPage">
<StackLayout>
<ListView SelectionMode="Single">
<ListView.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>mono</x:String>
<x:String>monodroid</x:String>
<x:String>monotouch</x:String>
<x:String>monorail</x:String>
<x:String>monodevelop</x:String>
<x:String>monotone</x:String>
<x:String>monopoly</x:String>
<x:String>monomodal</x:String>
<x:String>mononucleosis</x:String>
</x:Array>
</ListView.ItemsSource>
</ListView>
</StackLayout>
选择"monotouch"时,视图看起来像下面的图像,无论是在模拟器还是在设备上。我本以为 "monotouch" 行会出现灰色选择栏,但它只修改了行边框。
这是 Xamarin.Forms 4.3.0.908675(截至该日期的最新版本)。我尝试回滚到 Forms 4.0 和 3.6 并在两者上看到相同的结果,这使得它看起来像是 iOS 13?
中的新内容我尝试搜索有此问题的其他人,但只找到有关更改或隐藏突出显示颜色的文章;我只是想匹配系统行为。
还有其他人碰到过这个吗?有任何想法吗?谢谢!
新版本修复了这个错误
Wednesday, October 30, 2019 - Xamarin.Forms 4.3.0.947036 (4.3.0 Service Release 1)
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/release-notes/4.3/4.3.0-sr1