上一页 1 ··· 6 7 8 9 10 11 12 13 下一页

2013年11月24日

摘要: TableView的设置1.设置table头部和底部的view// 底部(宽度固定是320)tableView.tableFooterView = footer;// 头部(宽度固定是320)tableView.tableHeaderView = header;2.设置每一组头部和底部的高度tableView.sectionHeaderHeight = 5;tableView.sectionFooterHeight = 0;3.设置tableView的背景// 当tableview的样式为group时,如果想更换背景,必须清除默认条纹状的backgroundView// backgroundV 阅读全文
posted @ 2013-11-24 21:38 林源 阅读(347) 评论(0) 推荐(0) 编辑
摘要: 一、Cell的设置1.设置cell的背景view和选中时的背景viewUIImageView *bg = [[UIImageView alloc] init];bg.image = [UIImage imageNamed:@"abc.png"];cell.backgroundView = bg;UIImageView *selectedBg = [[UIImageView alloc] init];selectedBg.image = [UIImage imageNamed:@"cde.png"];cell.selectedBackgroundView 阅读全文
posted @ 2013-11-24 21:24 林源 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 1.显示HUDMBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];hud.labelText = @"哥正在加载中...";hud.dimBackground = YES;2.移除hud[MBProgressHUD hideAllHUDsForView:self.view animated:YES]; 阅读全文
posted @ 2013-11-24 21:08 林源 阅读(300) 评论(0) 推荐(0) 编辑
摘要: 1.依赖的框架* MobileCoreServices.framework* SystemConfiguration.framework* Security.framework2.主头文件:AFNetworking.h3.创建POST请求对象// BaseURL是基准路径,格式为-> 协议头://主机名,不能包含其他路径AFHTTPClient *client = [AFHTTPClient clientWithBaseURL:[NSURL URLWithString:@"https://api.weibo.com"]];// Method是请求方法// path是拼 阅读全文
posted @ 2013-11-24 21:06 林源 阅读(405) 评论(0) 推荐(0) 编辑
摘要: 一、动态改变Cell的高度1.利用tableView代理方法的返回值决定每一行cell的高度- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath二、UIFont// 返回字体的行高* [UIFont systemFontOfSize:10].lineHeight 阅读全文
posted @ 2013-11-24 21:04 林源 阅读(575) 评论(0) 推荐(0) 编辑
摘要: 一、SDWebImage的使用1.依赖的框架* ImageIO.framework* MapKit.framework2.UIImageView下载图片需要的头文件:UIImageView+WebCache.h3.调用方法下载图片// url是图片路径// placeholder是占位图片(正在下载图片时,暂时显示的图片)// options是缓存策略- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder- (void)setImageWithURL:(NSURL *)url placeholde 阅读全文
posted @ 2013-11-24 21:02 林源 阅读(1260) 评论(0) 推荐(0) 编辑
摘要: 一、自动伸缩属性UIViewAutoresizingNone 不伸缩UIViewAutoresizingFlexibleLeftMargin 跟父控件左边的距离自动伸缩UIViewAutoresizingFlexibleRightMargin 跟父控件右边的距离自动伸缩UIViewAutoresizingFlexibleTopMargin 跟父控件顶部的距离自动伸缩UIViewAutoresizingFlexibleBottomMargin 跟父控件底部的距离自动伸缩UIViewAutoresizingFlexibleWidth 宽度跟随父控件宽度自动伸缩UIView... 阅读全文
posted @ 2013-11-24 20:59 林源 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 0.先加入主头文件#import "MJRefresh.h"1.添加下拉刷新MJRefreshHeaderView *header = [MJRefreshHeaderView header];header.scrollView = self.tableView;header.delegate = self;2.添加上拉加载更多MJRefreshFooterView *footer = [MJRefreshFooterView footer];footer.scrollView = self.tableView;footer.delegate = self;3.监听刷新状态 阅读全文
posted @ 2013-11-24 20:57 林源 阅读(651) 评论(2) 推荐(0) 编辑

2013年11月22日

摘要: 微博正文开发步骤总结1.新建正文控制器,在点击首页的某一条微博时跳转过去2.在MainController中设置导航控制器的代理,监听所有导航控制器的跳转1> 如果即将显示的不是根控制器* 将导航控制器view的高度拉长为屏幕的高度(不包括状态栏高度)* 添加Dock到跟控制器(目的是在切换控制器时,Dock能随着根控制器一起移动。注意设置Dock的y值,当根控制器view是UIScrollView时,要加上contentOffset的y值。)* 给即将显示的控制器添加左上角的返回按钮2> 如果显示完毕的是根控制器* 将导航控制器view的高度还原为默认高度(屏幕高度 - Dock 阅读全文
posted @ 2013-11-22 22:06 林源 阅读(287) 评论(0) 推荐(0) 编辑
摘要: 一、tableView每组的头部控件1.控件宽度默认就是tableView的宽度2.控件高度由下面的代理方法决定- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section二、通过tableView的代理方法控制某一行的cell能否达到高亮选中状态- (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath 阅读全文
posted @ 2013-11-22 22:02 林源 阅读(404) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 下一页

导航