听说有个constraint的方法,但是不知道具体怎么操作,应该写在那个方法里(个人觉得应该写在textViewChanged:里边),不知道有哪位大人写过类似的程序,求指导!
要根据输入的文字动态改变宽和高,比如输入一个字母,宽增加一个位置,按回车,高增加一行,要求宽高都是动态改变的。
要根据输入的文字动态改变宽和高,比如输入一个字母,宽增加一个位置,按回车,高增加一行,要求宽高都是动态改变的。
解决方案 »
- 使用警告框实现登录功能
- 请问button有名字吗?
- 关于ios 文件结构的问题
- 关于iphone记不住cookie问题
- 苹果笔记本是否适用。net开发
- 请教: AppStore中关于支付安全性的问题
- ios开发收回键盘使用了第三方的IQKeyboardManager 有时候会出现黑屏???怎么搞啊?求大神啊
- iOS 如何实现下载word,excel,pdf文件到沙盒
- 请教下socket和http在客户端网络请求中的区别,请大神求教
- ios状态栏和tabbar显示异常?有人碰到过嘛
- 说说自己公司用什么版本XCODE
- sqlite3_prepare_v2得到sqlite3_stmt后如何知道列的数量和名字?
参考下一下几个方法:// Wrapping to fit horizontal and vertical size. Text will be wrapped and truncated using the NSLineBreakMode. If the height is less than a line of text, it may return
// a vertical size that is bigger than the one passed in.
// If you size your text using the constrainedToSize: methods below, you should draw the text using the drawInRect: methods using the same line break mode for consistency
- (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size; // Uses NSLineBreakModeWordWrap
- (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(NSLineBreakMode)lineBreakMode; /