iOS开发笔记--彩色小图标显示方法

来源:互联网 发布:手机文件管理 软件 编辑:程序博客网 时间:2024/04/30 07:47

UIButton *animationBtn = [UIButton buttonWithType:UIButtonTypeCustom];        animationBtn.frame = CGRectMake(x, y, width, height);        animationBtn.titleLabel.font = [UIFont boldSystemFontOfSize:10];        [animationBtn setBackgroundColor:UIColorFromRGB(0xFF8F2C)];        [animationBtn setTitle:@"免费"                      forState:UIControlStateNormal];        [animationBtn setUserInteractionEnabled:NO];        animationBtn.layer.cornerRadius = 1.5;        animationBtn.layer.masksToBounds = YES;        [self.view addSubview:animationBtn];



实现效果图:


0 0