ios学习记录

git 上 clone 下来 pod install 出错

使用 pod update --verbose

输入框光标的颜色
[[UITextField appearance] setTintColor:[UIColor blackColor]];

下拉上部 frame 改变

  • (void)scrollViewDidScroll:(UIScrollView *)scrollView{
    CGPoint offst = scrollView.contentOffset;
    CGFloat width = self.view.bounds.size.width;
    CGFloat height = self.view.bounds.size.height;
    self.scrollView.frame = CGRectMake(0, offst.y, width, height);
    if (offst.y <= -64.000000) {
    self.imageView = self.scrollView.subviews[0];
    CGRect newFrame = self.imageView.frame;
    CGFloat difference = (self.top - offst.y) / 3;
    newFrame.origin.x -= difference;
    newFrame.origin.y -= difference;
    newFrame.size.height += difference * 2.563;
    newFrame.size.width += difference * 2;
    self.imageView.frame = newFrame;
    self.top = offst.y;
    }
    }
  • (CGFloat)cellHeight:(NSString *)content {
    /字符串类目方法,计算高度/
    CGRect rect = [content boundingRectWithSize:CGSizeMake([UIScreen mainScreen].bounds.size.width / 2, 0) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:17.0f]} context:nil];
    return rect.size.height + 41;
    }

  • (CGFloat)cellHeight:(NSString *)imageName {
    /根据UIImage的size属性, 计算高度/
    UIImage *image = [UIImage imageNamed:imageName];
    return [UIScreen mainScreen].bounds.size.width * image.size.height / image.size.width;
    }

中文 转 NSString
http://nshipster.cn/cfstringtransform/

iOS xcode 注释

//TODO: -----------
//FIXME: ----------
//MARK: -----------

iOS NSURLCache

缓存策略 CachePolicy 存储到 Cache
POST 不可缓存

self.view endEditing:YES

URL uniform resource locator
协议://主机地址/路径

UIButton

{
括号内设置 为实例变量
}
@property 此为属性 属性比实例变量多 setter getter 方法 当有有例外

UIButton.textLabel 为实例变量
所以 UIButton.textLabel.text = @“” 这样会造成赋值失败
系统有自带的 setter方法 setTitle ………….

//居中

label.center = CGPointMake(CGRectGetMidX(view.bounds), CGRectGetMidY(view.bounds));

// 这两个方法又什么区别
NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:15];

NSURLRequest *request = [NSURLRequest requestWithURL:url];

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值