- 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];
iOS开发笔记--彩色小图标显示方法
最新推荐文章于 2025-09-01 10:25:01 发布
本文介绍如何使用 Objective-C 对 UIButton 进行自定义样式设置,包括按钮大小、字体、背景颜色、圆角等属性。
3928

被折叠的 条评论
为什么被折叠?



