zoukankan      html  css  js  c++  java
  • iOS CGRectGetMaxX/Y 使用

    在iOS的界面布局中我们可以使用CGRectGetMaxX 这个方法来方便的获取当前控件的x坐标值+宽度的数值,这样便可以方便布局。

    同理CGRectGetMaxY是获取y坐标值+ 控件高度的值,当然这个系列的方法还有很多大家可以试下。

    /* Return the leftmost x-value of `rect'. */CG_EXTERN CGFloat CGRectGetMinX(CGRect rect)CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0);/* Return the midpoint x-value of `rect'. */CG_EXTERN CGFloat CGRectGetMidX(CGRect rect)CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0);/* Return the rightmost x-value of `rect'. */CG_EXTERN CGFloat CGRectGetMaxX(CGRect rect)CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0);/* Return the bottommost y-value of `rect'. */CG_EXTERN CGFloat CGRectGetMinY(CGRect rect)CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0);/* Return the midpoint y-value of `rect'. */CG_EXTERN CGFloat CGRectGetMidY(CGRect rect)CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0);/* Return the topmost y-value of `rect'. */CG_EXTERN CGFloat CGRectGetMaxY(CGRect rect)CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0);/* Return the width of `rect'. */CG_EXTERN CGFloat CGRectGetWidth(CGRect rect)CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0);/* Return the height of `rect'. */CG_EXTERN CGFloat CGRectGetHeight(CGRect rect)CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0);
  • 相关阅读:
    668. Kth Smallest Number in Multiplication Table
    658. Find K Closest Elements
    483. Smallest Good Base
    475. Heaters
    454. 4Sum II
    441. Arranging Coins
    436. Find Right Interval
    410. Split Array Largest Sum
    392. Is Subsequence
    378. Kth Smallest Element in a Sorted Matrix
  • 原文地址:https://www.cnblogs.com/konglei/p/4910450.html
Copyright © 2011-2022 走看看