zoukankan      html  css  js  c++  java
  • 【iOS开发】iOS开发CGRectGetMidX. CGRectGetMidY.CGRectGetMinY. CGRectGetMaxY. CGRectGetMinX. CGRectGetMaxX的使用


    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)); 2015-04-24 15:39:15.577 webView[15743:677046] CGRectGetHeight--150.000000 2015-04-24 15:39:15.577 webView[15743:677046] CGRectGetMaxX--120.000000 2015-04-24 15:39:15.577 webView[15743:677046] CGRectGetMaxY--160.000000 2015-04-24 15:39:15.577 webView[15743:677046] CGRectGetMidX--65.000000 2015-04-24 15:39:15.578 webView[15743:677046] CGRectGetMidY--85.000000 2015-04-24 15:39:15.578 webView[15743:677046] CGRectGetMinX--10.000000 2015-04-24 15:39:15.578 webView[15743:677046] CGRectGetMinY--10.000000
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
     
  • 相关阅读:
    [收藏] WAP网关应用
    关于Symbian编程的基础知识— 基本数据类型
    PDU短信的编码一般规则
    同级方法异步调用(2016.05.04更新)
    OpenStack Manila发展动态系列Austin峰会
    OpenStack Cinder发展动态系列Austin峰会
    OpenStack Neutron单网卡桥接模式访问外网
    每日一测3(结构和类的异同)
    每日一测2(关于构造函数)
    每日一测1(带命令行参数运行)
  • 原文地址:https://www.cnblogs.com/paranoia/p/5803383.html
Copyright © 2011-2022 走看看