用variablesiOS更改背景颜色
我想用variables来改变标签的背景颜色,我该怎么做?
这是我的代码,但我想有一个variables,而不是'redColor'
[publisherLabel setBackgroundColor:[UIColor redColor]];
用RGBA值的颜色variables。
UIColor *myColor = [UIColor colorWithRed:100.0/255.0 green:101.0/255.0 blue:102.0/255.0 alpha:1.0]];
如果你愿意,你也可以使用HEX:
#define HEXCOLOR(c) [UIColor colorWithRed:((c>>24)&0xFF)/255.0 green:((c>>16)&0xFF)/255.0 blue:((c>>8)&0xFF)/255.0 alpha:((c)&0xFF)/255.0]; // usage: UIColor* c = HEXCOLOR(0xff00ffff);
- 如何完全着色UIPopoverPresentationController背景色?
- Xcode显示UITableRowSelection后的UIAlertView?
- 如何在Swift中分配CoreData多对多的关系?
- 将ReactiveCocoa中的信号合并成一个新的,当所有的改变都会触发
- 如何在Objective C中初始化一个空的可变数组
- activateConstraints:和deactivateConstraints:在IB中创build的约束旋转后不保留
- UITableViewCell上的UIPanGestureRecognizer覆盖UITableView的滚动视图手势识别器
- 将predicateWithFormat中的参数作为parameter passing给谓词
- 将iOS应用程序移植到mac – 如何处理内存pipe理?