Skip to content

[bug] ASCellNode has no background color in iOS 13 #2009

Open
@CainLuo

Description

@CainLuo

ASCellNode has no background color in iOS 13 version, but it is normal in iOS 12 or iOS 14, how can I fix it? @garrettmoon

class AboutCell: ASCellNode {
    private let titleNode = ASTextNode()
    private let lineNode = ASImageNode()

    init(_ model: AboutModel) {
        super.init()
        automaticallyManagesSubnodes = true
        accessoryType = .disclosureIndicator
        lineNode.isHidden = model.type == .privacy
        lineNode.style.flexGrow = 1.0
        lineNode.backgroundColor = UIColor(0xE9E9E9)
        titleNode.attributedText = NSAttributedString.attributed(model.title ?? "")
    }
    
    override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec {
        LayoutSpec {
            VStackLayout {
                CenterLayout(centeringOptions: .Y) {
                    InsetLayout(insets: .zero) {
                        titleNode
                    }
                }
                .minHeight(frame.maxY - 1)
                lineNode
            }
            .padding(UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 15))
        }
    }
}

iOS 13
image

iOS 14
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions