首页 > 移动平台 > 详细

IOS开发基础知识--碎片31

时间:2016-01-05 01:25:46      阅读:149      评论:0      收藏:0      [点我收藏+]

1:UITableViewCell drawInRect 在iOS7中失败

解决办法,把Cell里的布局移到新建的View里面,在View里面实现DrawInRect,然后在Cell里面加载View,代码如下:

@implementation CustomTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self.contentView addSubview:[[CustomContentView alloc]initWithFrame:self.contentView.bounds]];
    }
    return self;
}

@end
@implementation CustomContentView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
    }
    return self;
}


- (void)drawRect:(CGRect)rect
{
    NSDictionary * attributes = @{
                                  NSFontAttributeName : [UIFont fontWithName:@"Helvetica-bold" size:12],
                                  NSForegroundColorAttributeName : [UIColor blackColor]
                                  };

    [@"I <3 iOS 7" drawInRect:rect withAttributes:attributes];
}

@end

 2:YTKNetwork的内容

YTKNetwork 是猿题库 iOS 研发团队基于 AFNetworking 封装的 iOS 网络库,其实现了一套 High Level 的 API,提供了更高层次的网络访问抽象。

YTKNetwork 使用基础教程
https://github.com/yuantiku/YTKNetwork/blob/master/BasicGuide.md

YTKNetwork 使用高级教程
https://github.com/yuantiku/YTKNetwork/blob/master/ProGuide.md

IOS开发基础知识--碎片31

原文:http://www.cnblogs.com/wujy/p/5089821.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!