类方法创建label

来源:互联网 发布:开票软件的控制台 编辑:程序博客网 时间:2024/05/21 07:54

+ (UILabel *)creatLabelWithFrame:(CGRect )frame

                           title:(NSString *)title

                      titleColor:(UIColor *)titleColor

                            font:(NSInteger )font {

    

    UILabel *label = [[UILabelalloc] initWithFrame:frame];

    label.text = title;

    label.font = [UIFontsystemFontOfSize:font];

    label.textColor = titleColor;

    

    return label;

}

0 0
原创粉丝点击