共 8 篇文章 |
|
那么刷新(reload)UITableView时,UITableView会先调用100次tableView:heightForRowAtIndexPath:方法,然后调用5次tableView:cellForRowAtIndexPath:方法;这样写,在Cell赋值内容的时候,会根据内容设置布局,当然也就可以知道Cell的高度,想想如果1000行,那就会调用1000+页面Cell个数次tableView:(UITableView *)tableView cellForRowAtInd... 阅18 转0 评0 公众公开 15-06-17 10:59 |
UIWebView.2:设置UIWebView是按 WebView自适应大小显示,还是按正文内容的大小来显示。4:UIWebView 根据内容自动适应内容高度。// if ( ( [ [ requestURL scheme ] isEqualToString: @"http" ] || [ [ requestURL scheme ] isEqualToString: @"https" ] || [ [ requestURL scheme ] isEqualToString: @"mailto"... 阅82 转0 评0 公众公开 15-06-15 15:48 |
iOS自定义的导航条:CustomNavigationBar.于是想自定义一个,这样兼容iOS6与iOS7时,代码相对统一。- 提供创建导航条按钮的方法,可在外部自定义按钮添加到导航条上。- 封装了接入自定义导航条的方法,把具体业务与自定义导航条分开。- 所有需使用自定义导航条的视图控制器可直接继承此类。// 设置标题[self setNaviBarLeftBtn:nil]; // ... 阅4884 转0 评0 公众公开 15-06-10 17:19 |
iphone自定义UITextView的placeholder.self.textView.placeholder = @"请添写你的信息……"; // Do any additional setup after loading the view, typically from a nib. } -(void)viewDidAppear:(BOOL)animated { [super viewDidAppear:YES]; [self.textView addObserver]; } -(void)viewDidDisappear:(... 阅53 转1 评0 公众公开 15-06-08 18:20 |
阅13 转0 评0 公众公开 15-06-08 18:13 |
ios动态获取UILabel的高度和宽度。CGSize sz = [label.text sizeWithFont:label.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];CGSize linesSz = [label.text sizeWithFont:label.font constrainedToSize:CGSizeMake(label.frame.size.width, MAXFLOAT) lineBreakMode:UILineBreakModeWordWrap];lastPoint = CGPointMake(label.frame.orig... 阅20 转1 评0 公众公开 15-06-08 17:22 |
for (id family in familyArray) {printf(“%s\n”,[family cStringUsingEncoding:NSUTF8StringEncoding]);NSArray *fontArray = [UIFont fontNamesForFamilyName:family];for (id font in fontArray) {printf(” %s\n”,[font cStringUsingEncoding:NSUTF8StringEncoding]);}}NSString *const NSParagraphStyleAttributeName;//值为NSParagra... 阅3044 转5 评0 公众公开 15-06-08 17:22 |
UICollectionView详解 什么是UICollectionView.-(UICollectionView*)collectionView:(UICollectionView*)cvcellForItemAtIndexPath:(NSIndexPath*)indexPath{ MyCell*cell=[cvdequeueReusableCellWithReuseIdentifier:@”MY_CELL_ID”]; // Configure the cell''s content cell.imageView.image=... returncell;}Flow Lay... 阅100 转0 评0 公众公开 15-06-08 16:59 |