Easy 2 OC 参考 之 UICollectionReusableView

设计图:
E509A8C3-66AF-4E67-B779-0C0CB17

实现代码:

UICollectionReusableView {
    name = ZSIndexHeaderNews;
    onlyCreate = view;
    bgColor = #f5f6f7;
    toPath = ZhongShuo/AppSetup/Section/Index;
    edges = 0;
    
    UIView {
        layer.cornerRadius = 16;
        bgColor = #ffffff;
        left = 20;
        right = -20;
        top.bottom = 0;
        
        UIButton {
            id = moreButton;
            right = 0;
            top.bottom = 0;
            width = 35;
            font = 15;
            text = "更多";
            textColor = #112233;
        }
        
        UILabel {
            id = titleLabel;
            text = "  众烁";
            left = 0;
            top.bottom = 0;
            font = 15;
            textColor = #313233;
        }
        UILabel {
            bgColor = #fa642d;
            id = titleLabel2;
            text = "快报";
            left = titleLabel.right;
            font = 15;
            textColor = #ffffff;
            centerY = parent;
        }
        
        UILabel {
            id = contentLabel;
            top.bottom = 0;
            left = titleLabel2.right.6;
            right = moreButton.left.-6;
            text = "世界第一公主殿下,初音未来,你知道吗?我知道啊,挺漂亮的,而且有很多个样式!";
            font = 15;
            textColor = #112233;
        }
    }
}