xamarin.forms - 从 iOS 上的 ListView 组标题中删除背景颜色

标签 xamarin.forms

我在 ListView 中启用了分组,并且组标题具有浅灰色背景色。
如何删除它\使其透明?

最佳答案

iOS 设置 Cell 实例的默认背景颜色。您可以通过 iOS platform-specific property 更改它:

<ListView xmlns="http://xamarin.com/schemas/2014/forms"
          xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
          xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core">
  <ListView.GroupHeaderTemplate>
    <DataTemplate>
      <ViewCell ios:Cell.DefaultBackgroundColor="Transparent">
        <!--other views...-->
      </ViewCell>
    </DataTemplate>
  </ListView.GroupHeaderTemplate>
</ListView>

关于xamarin.forms - 从 iOS 上的 ListView 组标题中删除背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46746843/

相关文章:

c# - 将签名上传到 Azure Blob 存储

xamarin.forms - 如何向选项卡/轮播页面添加滑动点?

c# - 在 Xamarin.Forms 中编写特定于设备平台的代码

c# - 检测用户跳到 AVPlayer 视频的结尾

c# - Xamarin : Objective-C exception on adding objects to an observable collection

xamarin.forms - StackLayout 两列,每列占用一半的空间

mvvm - 如何使用 xamarin 表单提高移动设备的性能

xamarin.forms - 如何确定xamarin表单中的当前滚动偏移量

c# - 无法访问派生类中的基属性 (C#)

c# - 如何将 MySQL 数据库中的数据绑定(bind)到 Xamarin ListView?