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));
    
  • 相关阅读:
    25 Groovy 相关资料
    24 使用Maven 或 Gradle构建groovy
    UVA
    UVA
    UVA
    UVA
    UVA
    【JZOJ4235】序列【数论,数学】
    【JZOJ4235】序列【数论,数学】
    【JZOJ5230】队伍统计【状压DP】
  • 原文地址:https://www.cnblogs.com/chenjiangxiaoyu/p/7327127.html
Copyright © 2011-2022 走看看