CGRectGetMaxX/Y 使用

<span style="font-size:18px;"><code class="hljs vhdl has-numbering"> UILabel *<span class="hljs-keyword">label</span> = [[UILabel alloc]initWithFrame:CGRectMake(<span class="hljs-number">10</span>, <span class="hljs-number">10</span>, <span class="hljs-number">110</span>, <span class="hljs-number">150</span>)];
    <span class="hljs-keyword">label</span>.backgroundColor = [UIColor orangeColor];
    [self.view addSubview:<span class="hljs-keyword">label</span>];
    <span class="hljs-comment">/*
<span style="color:#FF0000;"><span style="background-color: rgb(255, 255, 255);">     CGRectGetHeight返回label本身的高度
     CGRectGetMinY返回label顶部的坐标
     CGRectGetMaxY 返回label底部的坐标
     CGRectGetMinX 返回label左边缘的坐标
     CGRectGetMaxX 返回label右边缘的坐标
     CGRectGetMidX表示得到一个frame中心点的X坐标
     CGRectGetMidY表示得到一个frame中心点的Y坐标</span></span>
     */</span>
    NSLog(@<span class="hljs-string">"CGRectGetHeight--%f"</span>, CGRectGetHeight(<span class="hljs-keyword">label</span>.frame));
    NSLog(@<span class="hljs-string">"CGRectGetMaxX--%f"</span>, CGRectGetMaxX(<span class="hljs-keyword">label</span>.frame));
    NSLog(@<span class="hljs-string">"CGRectGetMaxY--%f"</span>, CGRectGetMaxY(<span class="hljs-keyword">label</span>.frame));
    NSLog(@<span class="hljs-string">"CGRectGetMidX--%f"</span>, CGRectGetMidX(<span class="hljs-keyword">label</span>.frame));
    NSLog(@<span class="hljs-string">"CGRectGetMidY--%f"</span>, CGRectGetMidY(<span class="hljs-keyword">label</span>.frame));
    NSLog(@<span class="hljs-string">"CGRectGetMinX--%f"</span>, CGRectGetMinX(<span class="hljs-keyword">label</span>.frame));
    NSLog(@<span class="hljs-string">"CGRectGetMinY--%f"</span>, CGRectGetMinY(<span class="hljs-keyword">label</span>.frame));

    <span class="hljs-number">2015</span>-<span class="hljs-number">04</span>-<span class="hljs-number">24</span> <span class="hljs-number">15</span>:<span class="hljs-number">39</span>:<span class="hljs-number">15.577</span> webView[<span class="hljs-number">15743</span>:<span class="hljs-number">677046</span>] CGRectGetHeight<span class="hljs-comment">--150.000000</span>
    <span class="hljs-number">2015</span>-<span class="hljs-number">04</span>-<span class="hljs-number">24</span> <span class="hljs-number">15</span>:<span class="hljs-number">39</span>:<span class="hljs-number">15.577</span> webView[<span class="hljs-number">15743</span>:<span class="hljs-number">677046</span>] CGRectGetMaxX<span class="hljs-comment">--120.000000</span>
    <span class="hljs-number">2015</span>-<span class="hljs-number">04</span>-<span class="hljs-number">24</span> <span class="hljs-number">15</span>:<span class="hljs-number">39</span>:<span class="hljs-number">15.577</span> webView[<span class="hljs-number">15743</span>:<span class="hljs-number">677046</span>] CGRectGetMaxY<span class="hljs-comment">--160.000000</span>
    <span class="hljs-number">2015</span>-<span class="hljs-number">04</span>-<span class="hljs-number">24</span> <span class="hljs-number">15</span>:<span class="hljs-number">39</span>:<span class="hljs-number">15.577</span> webView[<span class="hljs-number">15743</span>:<span class="hljs-number">677046</span>] CGRectGetMidX<span class="hljs-comment">--65.000000</span>
    <span class="hljs-number">2015</span>-<span class="hljs-number">04</span>-<span class="hljs-number">24</span> <span class="hljs-number">15</span>:<span class="hljs-number">39</span>:<span class="hljs-number">15.578</span> webView[<span class="hljs-number">15743</span>:<span class="hljs-number">677046</span>] CGRectGetMidY<span class="hljs-comment">--85.000000</span>
    <span class="hljs-number">2015</span>-<span class="hljs-number">04</span>-<span class="hljs-number">24</span> <span class="hljs-number">15</span>:<span class="hljs-number">39</span>:<span class="hljs-number">15.578</span> webView[<span class="hljs-number">15743</span>:<span class="hljs-number">677046</span>] CGRectGetMinX<span class="hljs-comment">--10.000000</span>
    <span class="hljs-number">2015</span>-<span class="hljs-number">04</span>-<span class="hljs-number">24</span> <span class="hljs-number">15</span>:<span class="hljs-number">39</span>:<span class="hljs-number">15.578</span> webView[<span class="hljs-number">15743</span>:<span class="hljs-number">677046</span>] CGRectGetMinY<span class="hljs-comment">--10.000000</span></code></span>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值