我正在使用此代码
CGRect frame = self.mytext.frame;
frame.size.height = self.mytext.contentSize.height;
self.mytext.frame = frame;
Run Code Online (Sandbox Code Playgroud)
但它在iOS 7中不起作用.有谁知道为什么或有同样的问题?
编辑:
抱歉.我制作了一个UIView,一个UITextView和一个UIScrollView,所以我可以在我的uitextview展开中加载文本.
我在viewDidLoad中使用了这段代码
CGRect frame = self.moreDetailsTextView.frame;
frame.size.height = self.moreDetailsTextView.contentSize.height;
self.moreDetailsTextView.frame = frame;
CGRect moreViewFrame = self.moreDetailsView.frame;
moreViewFrame.size.height = frame.size.height + 270;
self.moreDetailsView.frame = moreViewFrame;
int scrollViewHeight = moreViewFrame.size.height + 235;
self.scrollView.contentSize = CGSizeMake(320, scrollViewHeight);
Run Code Online (Sandbox Code Playgroud)
这在ios6中运行良好,但是现在使用xcode5和ios7,当我在模拟器中测试应用程序时,uitextview不会扩展.
我的应用程序在ios 7中运行没有任何问题但是当我在ios 6中运行它时它会下降.该报告是:
2013-10-17 22:58:45.509 Santarem Guide[606:c07] -[_UIAppearance setTintColor:]: unrecognized selector sent to instance 0xa149390
2013-10-17 22:58:45.510 Santarem Guide[606:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_UIAppearance setTintColor:]: unrecognized selector sent to instance 0xa149390'
*** First throw call stack:
(0x29d8012 0x1951e7e 0x2a634bd 0x29c7bbc 0x29c794e 0x7ade 0x8967b7 0x896da7 0x897fab 0x8a9315 0x8aa24b 0x89bcf8 0x2e69df9 0x2e69ad0 0x294dbf5 0x294d962 0x297ebb6 0x297df44 0x297de1b 0x8977da 0x89965c 0x2dfd 0x20fa725)
libc++abi.dylib: terminate called throwing an exception
(lldb)
Run Code Online (Sandbox Code Playgroud)
有人有这个问题吗?
在我的App Delegate中我有[[UIView外观] setTintColor:[UIColor whiteColor]]; 如果我将其转为[[UIView外观] setBackgroundColor:[UIColor whiteColor]]; 我得到一个新的错误 …