最大CGFloat值是否有常量? [英] Is there a constant for the maximum CGFloat value?

查看:160
本文介绍了最大CGFloat值是否有常量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建一个CGSize来计算任意长度的任意文本的文本高度。 UIKit有这个很好的方法-sizeWithFont:constrainedToSize:我的文本只限制宽度,但不是高度。

I need to create a CGSize to compute text height of an arbitrary text with arbitrary length. UIKit has this nice method -sizeWithFont:constrainedToSize: and my text is only constrained in width, but not in height.

为此,我需要设置最大可能的CGFloat高度。

For this, I need to set the maximum possible CGFloat for the height.

是否有像CGFloatMax这样的常量?

Is there a constant like "CGFloatMax"?

推荐答案

CGGeometry 定义:

#define CGFLOAT_MAX FLT_MAX

这篇关于最大CGFloat值是否有常量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆