-(UIView *)viewGetByDate{ UIView *view=[[UIView alloc]initWithFrame:CGRectMake(20, 20, 180, 50)]; //view.backgroundColor=[UIColor redColor]; UIButt...
分类:
其他好文 时间:
2015-04-23 21:32:43
阅读次数:
148
//选中某个row
UIView * v = [[[UIView
alloc] init]autorelease];
v.backgroundColor = [UIColor
grayColor];
cell.selectedBackgroundView = v;...
分类:
数据库 时间:
2015-04-23 17:30:56
阅读次数:
116
1、视图的显示基于图层,通过控制图层同样能控制显示效果,获取当前的视图的layer,并为其增加圆角边框。
//设置layer边框的宽度为2
view.layer.borderWidth=2;
//如果需要为layer添加颜色需要转换为CGColor对象
view.layer.borderColor=[UIColor greenColor].CGColor;
//将边框...
分类:
其他好文 时间:
2015-04-22 18:30:30
阅读次数:
132
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor],NSForegroundColorAttributeName, nil] forState:UIControlStateNormal];...
分类:
移动开发 时间:
2015-04-22 14:00:57
阅读次数:
133
//改变导航栏标题颜色及字体大小 e.g设置字体颜色为red 字体大小为18 self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor...
分类:
其他好文 时间:
2015-04-21 17:45:00
阅读次数:
135
1 + (UIImage *)circleImageWithName:(NSString *)name borderWidth:(CGFloat)borderWidth borderColor:(UIColor *)borderColor 2 { 3 4 // 1.加载原图 ...
分类:
其他好文 时间:
2015-04-19 21:10:44
阅读次数:
121
点标记语法
属性和幂等方法(多次调用和一次调用返回的结果相同)使用点标记语法访问,其他的情况使用方括号标记语法。
良好的风格:
view.backgroundColor = [UIColor orangeColor];
[UIApplication sharedApplication].delegate;
不良的风格:
[view setBa...
分类:
移动开发 时间:
2015-04-17 20:37:14
阅读次数:
246
- (void)viewDidLoad {
[super
viewDidLoad];
self.view.backgroundColor = [UIColor
lightGrayColor];
//确定是水平滚动,还是垂直滚动
UICollectionViewFlowLayout *flowLayout=[[UICollectionViewFlowLay...
分类:
其他好文 时间:
2015-04-17 14:03:45
阅读次数:
96
给UIColor写一个延展:
#import
@interface UIColor (color)
+ (UIColor*)colorWithHexString:(NSString*)hex;
+ (UIColor*)colorWithHexString:(NSString*)hex withAlpha:(CGFloat)alpha;
...
分类:
移动开发 时间:
2015-04-16 17:47:49
阅读次数:
126
- (void)setGradientColor:(UIColor *)beginColor transitionColor:(UIColor *)transitionColor,...NS_REQUIRES_NIL_TERMINATION ;
// NS_REQUIRES_NIL_TERMINATION,
用于编译时非nil结尾的检查
- (void)setGradientC...
分类:
移动开发 时间:
2015-04-16 17:33:50
阅读次数:
126