zoukankan      html  css  js  c++  java
  • ios CGRectGet...位置属性的基本介绍

    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 110, 150)];

    label.backgroundColor = [UIColor orangeColor];

    [self.view addSubview:label];

    /* CGRectGetHeight返回label本身的高度

    CGRectGetMinY返回label顶部的坐标

    CGRectGetMaxY 返回label底部的坐标

    CGRectGetMinX 返回label左边缘的坐标

    CGRectGetMaxX 返回label右边缘的坐标

    CGRectGetMidX表示得到一个frame中心点的X坐标

    CGRectGetMidY表示得到一个frame中心点的Y坐标 */

    NSLog(@"CGRectGetHeight--%f", CGRectGetHeight(label.frame));

    NSLog(@"CGRectGetMaxX--%f", CGRectGetMaxX(label.frame));

    NSLog(@"CGRectGetMaxY--%f", CGRectGetMaxY(label.frame));

    NSLog(@"CGRectGetMidX--%f", CGRectGetMidX(label.frame));

    NSLog(@"CGRectGetMidY--%f", CGRectGetMidY(label.frame));

    NSLog(@"CGRectGetMinX--%f", CGRectGetMinX(label.frame));

    NSLog(@"CGRectGetMinY--%f", CGRectGetMinY(label.frame));

    2017-07-21 16:44:15.577 webView[15743:677046] CGRectGetHeight--150.000000

    2017-07-21 16:44:15.577 webView[15743:677046] CGRectGetMaxX--120.000000

    2017-07-21 16:44:15.577 webView[15743:677046] CGRectGetMaxY--160.000000

    2017-07-21 16:44:15.577 webView[15743:677046] CGRectGetMidX--65.000000

    2017-07-21 16:44:15.578 webView[15743:677046] CGRectGetMidY--85.000000

    2017-07-21 16:44:15.578 webView[15743:677046] CGRectGetMinX--10.000000

    2017-07-21 16:44:15.578 webView[15743:677046] CGRectGetMinY--10.000000

  • 相关阅读:
    Compile Groovy/Spock with GMavenPlus
    Jenkins Slave Nodes – using the Swarm Plugin
    [NodeJS]Jenkins-cli
    [CoffeeScript]使用Yield功能
    [JavaScript]String.format
    [CoffeeScript]在WebStorm里运行CoffeeScript
    自动化运维的三阶段理论
    [Ruby]Unzipping a file using rubyzip
    测试文章引用
    敏捷软件测试读书笔记
  • 原文地址:https://www.cnblogs.com/sunfuyou/p/7218492.html
Copyright © 2011-2022 走看看