1,使用UIColor的内置颜色设置背景色12var page = UIView()page.backgroundColor = UIColor.greenColor()2,设置自定义颜色1page.backgroundColor = UIColor(red: 0x37/255, green: 0x...
分类:
编程语言 时间:
2015-09-25 16:23:19
阅读次数:
910
1,比如rgb 色值为55、 186 、89 那么给UIColor设置里面要除以2551UIColor(red: 55/255, green: 186/255, blue: 89/255, alpha: 0.5)2,设置16进制颜色也同上1UIColor(red: 0x37/255, green: ...
分类:
编程语言 时间:
2015-09-25 16:14:39
阅读次数:
173
一提到UILabel的行间距,一般都是用下面的方法解决。 UILabel *label = [[UILabel alloc] initWithFrame:labelFrame]; [label setBackgroundColor:[UIColor clearColor]]; ...
分类:
其他好文 时间:
2015-09-24 16:29:50
阅读次数:
137
- (NSMutableAttributedString *)adjustTextColor:(NSString *)text rangeText:(NSString *)rangeText color:(UIColor *)color { NSRange range = [text rangeO....
分类:
其他好文 时间:
2015-09-24 14:40:00
阅读次数:
234
假如我们需要的tableview只有几行,并且行高很小,这样我们的tableview底部就有很多空的cell行,也就会许多无用的分割线,看起来很难看。我的做法如下,很简单:UIView *view = [UIView new]; view.backgroundColor = [UIColor cl....
分类:
移动开发 时间:
2015-09-23 10:28:30
阅读次数:
163
//tint color是设置你选中的那个tabBar的颜色,默认是蓝色,点击是设置的红色 vc.tabBar.tintColor = [UIColor redColor]; //bar tint color vc.tabBar.barTintColor = [UIColor orangeCol.....
分类:
其他好文 时间:
2015-09-22 21:53:21
阅读次数:
229
- (void)setExtraCellLineHidden: (UITableView *)tableView{ UIView *view =[ [UIView alloc]init]; view.backgroundColor = [UIColor clearColor]; [tab...
分类:
其他好文 时间:
2015-09-22 18:48:10
阅读次数:
113
不管UIColor使用CIColor,CGColor还是其他方式初始化的,其CGColor属性都是可用的。CoreGraphics中提供一个函数,用于判断两个CGColor是否相等,因此我们可以通过这个函数判断两个UIColor是否相等,下面是看一个简单的例子:// 判断两个颜色是否是同一种颜色if...
分类:
其他好文 时间:
2015-09-21 23:59:41
阅读次数:
743
CGSize imageSize = CGSizeMake(self.doneButton.frame.size.width, self.doneButton.frame.size.height); UIGraphicsBeginImageContextWithOptions(imageSiz...
分类:
其他好文 时间:
2015-09-21 17:13:28
阅读次数:
215
UIView *yellowView = [[UIView alloc] initWithFrame:CGRectMake(30, 30, 200, 200)]; yellowView.backgroundColor = [UIColor yellowColor]; [self.wind...
分类:
移动开发 时间:
2015-09-19 12:20:20
阅读次数:
193