2013年11月24日

摘要: 1 修改背景searchbar =[[UISearchBar alloc]initWithFrame:CGRectMake(0,KTopBarHeight, 320, KTopBarHeight)];searchbar.delegate=self;searchbar.keyboardType= UIKeyboardTypeDefault;//[[searchbar.subviews objectAtIndex:0]removeFromSuperview];UIImage *img = [[UIImage imageNamed: @"searchBar_bg.png"]str 阅读全文
posted @ 2013-11-24 22:01 林源 阅读(250) 评论(0) 推荐(0) 编辑
摘要: -(UITableViewCell*) tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath{staticNSString*CellIdentifier =@"Cell"; UITableViewCell*cell = [tableViewdequeueReusableCellWithIdentifier:CellIdentifier]; if(cell ==nil) {NSArray*array = [[NSBundlemainBundle]loadNibNamed: 阅读全文
posted @ 2013-11-24 21:43 林源 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 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) 编辑

导航