gpt4 book ai didi

ios13 - UITableView : selected cell color is not rendered in ios13

转载 作者:行者123 更新时间:2023-12-04 13:36:07 24 4
gpt4 key购买 nike

我正在使用 Xcode 11 beta 6,在选择 UITableViewcell 时,单元格没有突出显示。它有一个白色背景,而不是显示选定的背景颜色。

最佳答案

根据 iOS 13 发行说明 ( https://developer.apple.com/documentation/ios_ipados_release_notes/ios_ipados_13_beta_8_release_notes ) - 当单元格突出显示或被选中时,UITableViewCell 类不再更改 contentView 及其任何 subview 的 backgroundColor 或 isOpaque 属性。

The UITableViewCell class no longer changes the backgroundColor or isOpaque properties of the contentView and any of its subviews when cells become highlighted or selected. If you are setting an opaque backgroundColor on any subviews of the cell inside (and including) the contentView, the appearance when the cell becomes highlighted or selected might be affected. The simplest way to resolve any issues with your subviews is to ensure their backgroundColor is set to nil or clear, and their opaque property is false. However, if needed you can override the setHighlighted(:animated:) and setSelected(:animated:) methods to manually change these properties on your subviews when moving to or from the highlighted and selected states.

关于ios13 - UITableView : selected cell color is not rendered in ios13,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57697830/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com