ios13 Dark Mode change not recognized by tableview Cell?

前端 未结 2 1892
没有蜡笔的小新
没有蜡笔的小新 2021-01-24 22:57

I\'m checking my existing app to work correctly with the new introduced dark mode feature of ios 13.

Everything seems to work fine, only the cell background in one of m

2条回答
  •  走了就别回头了
    2021-01-24 23:54

    Cell will detect, layer will not! You must manually update all layer adaptations in the cell for example.

    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
        super.traitCollectionDidChange(previousTraitCollection)
    
        if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) {
            removeAndReaddGradientIfNeeded()
        }
    }
    

    More description here

提交回复
热议问题