zoukankan      html  css  js  c++  java
  • 笔记-CGRectInset CGRectoffset UIEdgeInsetsInsetRect 这三个函数的使用情况

    //CGRectInset  将原来的矩形放大或者缩小,正表示缩小,-表示放大。
    CGRect rect= CGRectMake(20, 50, 100, 80);
     CGRect rect1=CGRectInset(rect, -10, 20);
     NSLog(@"%@",p(rect1));
    //输出结果:2014-11-22 18:48:55.351 TestCGRectInset[8893:60b] {{10, 70}, {120, 40}}
    
    //CGRectOffset 这个函数就是将原来矩形的坐标点变化一下,就是左上角点
    CGRect rect= CGRectMake(20, 50, 100, 80);
    CGRect rect1=CGRectOffset(rect, -10, 20);
    NSLog(@"%@",p(rect1));
    //输出结果:2014-11-22 18:51:58.217 TestCGRectInset[8913:60b] {{10, 70}, {100, 80}}
    
     //UIEdgeInsetsInsetRect 表示在原来的rect基础上根据边缘距离内切一个rect出来
    CGRect rect= CGRectMake(20, 50, 100, 80);
    UIEdgeInsets ed=UIEdgeInsetsMake(-3, -4, -5, -6);
    CGRect  r=  UIEdgeInsetsInsetRect(rect, ed);
    NSLog(@"%@",p(r));
    
  • 相关阅读:
    Linux入门
    服务器核心知识
    跨域
    DRF的解析器和渲染器
    DRF的分页
    DRF 权限 频率
    DRF 版本 认证
    Django Rest Framework 视图和路由
    Serializers 序列化组件
    六、Java NIO 通道之间的数据传输
  • 原文地址:https://www.cnblogs.com/chenjiangxiaoyu/p/7327127.html
Copyright © 2011-2022 走看看