摘要:
1 NSArray *segmentedArray = [[NSArrayalloc]initWithObjects:@"one",@"two",@"three",@"four",nil]; 2 3 //初始化UISegmentedControl 4 UISegmentedControl *segmentedControl = [[UISegmentedControlalloc]initWithItems:segmentedArray]; 5 6 segmentedControl.frame = CGRectMak 阅读全文
摘要:
1 UILabel *label = [[[UILabel alloc] init] autorelease];2 label.textColor = [UIColor redColor];3 label.backgroundColor = [UIColor clearColor];4 label.font = [UIFont systemFontOfSize:20];5 label.numberOfLines = 0;//自动换行 阅读全文
摘要:
1 1 自定义Cell, 在Cell的构造方法里面添加好所有的子控件 2 3 2 在HeightForRowAtIndexPath方法中返回每一行Cell对应的高度 4 5 3 在Cell的layoutSubviews方法中重新布局子控件的位置和尺寸 6 7 //调用layoutSubviews重新布局Cell的 8 - (void)layoutSubviews{ 9 [super layoutSubviews];10 } statusFrame类计算微博所有子控件的高度 阅读全文
摘要:
//GCD下载后清除缓存1 —(void)didReceiveMemoryWarning{2 [super didReceiveMemoryWarning];3 //清除缓存4 [self.cache removeAllObjectds];5 //取消下载6 [self.queue cancelAllObjects];7 [self.downloading removeAllObjects];8 } 阅读全文
摘要:
1 //是否要显示分隔线2 tableView.separatorStyle = UITableViewCellSeparatorStyleNone;3 tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;4 5 //改变换行线颜色6 tableView.separatorColor = [UIColor blueColor];7 //设置tableView的头部位置的按钮或图片 UIImageView UIButton 8 self.tableView.tableHeaherView = [UIButton b 阅读全文
摘要:
1 // 设置cell的背景色2 UIView *bg = [[[UIView alloc] init] autorelease];3 bg.backgroundColor = [UIColor colorWithRed:0.95 green:0.95 blue:0.95 alpha:1];4 cell.backgroundView = bg;1 // 设置cell选中的背景2 UIView *selectdBg = [[[UIView alloc] init] autorelease];3 selectdBg.backgroundColor = [UIColor colorWithRed:0 阅读全文
摘要:
1 // 设置imageview的圆角半径2 UIImageView *imageView = (UIImageView *)[cell viewWithTag:tag];3 imageView.layer.cornerRadius = 10;4 imageView.layer.masksToBounds = YES;5 // 图片居中,而且限制在ImageView的bounds中6 imageView.contentMode = UIViewContentModeScaleAspectFit;7 // 接收触模事件8 imageView.userInteractionEnable... 阅读全文
摘要:
1 一、ASI类库集成: 2 1.添加源代码文件 3 ASIAuthenticationDialog.h 4 ASIAuthenticationDialog.m 5 ASICacheDelegate.h 6 ASIDataCompressor.h 7 ASIDataCompressor.m 8 ASIDataDecompressor.h 9 ASIDataDecompressor.m10 ASIDownloadCache.h11 ASIDownloadCache.m12 ASIFormDataRequest.h13 ASIFormDataRequest.m14 ASIHTTPRequest.. 阅读全文
摘要:
1 //当前视图的父视图添加和本视图同级的视图2 [self.view.superview addSubview:showview.view];3 //从父视图移除当前视图4 [self.view removeFromSuperview]; 阅读全文
摘要:
1 #pragma mark 快速创建一个item 2 - (UIBarButtonItem *)itemWithNormal:(NSString *)normal highlighted:(NSString *)highlighted selector:(SEL)selector { 3 // 初始化按钮 4 UIButton *button = [[[UIButton alloc] init] autorelease]; 5 button.title.font = [UIFont systemFontOfSize:10]; 6 // 设置按钮背景图片 7... 阅读全文