iOS7中 textField用autolayout发生问题

开发iOSAPP在iOS8中textField的没问题,约束也正常,换到iOS7的模拟器结果报错
报错信息为AutoLayoutstillrequiredafterexecuting-layoutSubviews.UITextField'simplementationof-layoutSubviewsneedstocallsuper.'
界面一共有两个textField,点击任意一个都会触发这个bug,导致程序崩溃.请问应该怎么解决?
另附堆栈信息
***Firstthrowcallstack:
(
0CoreFoundation0x000000010cdc5495exceptionPreprocess+165
1libobjc.A.dylib0x000000010c7bb99eobjc_exception_throw+43
2CoreFoundation0x000000010cdc531a+[NSExceptionraise:format:arguments:]+106
3Foundation0x000000010c357f19-[NSAssertionHandlerhandleFailureInMethod:object:file:lineNumber:description:]+189
4UIKit0x000000010d0dfa3a-[UIView(CALayerDelegate)layoutSublayersOfLayer:]+521
5QuartzCore0x000000010c1f7802-[CALayerlayoutSublayers]+151
6QuartzCore0x000000010c1ec369_ZN2CA5Layer16layout_if_neededEPNS_11TransactionE+363
7QuartzCore0x000000010c1ec1ea_ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE+24
8QuartzCore0x000000010c15ffb8_ZN2CA7Context18commit_transactionEPNS_11TransactionE+252
9QuartzCore0x000000010c161030_ZN2CA11Transaction6commitEv+394
10UIKit0x000000010d07e024_UIApplicationHandleEventQueue+10914
11CoreFoundation0x000000010cd54d21__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION+17
12CoreFoundation0x000000010cd545f2__CFRunLoopDoSources0+242
13CoreFoundation0x000000010cd7046f__CFRunLoopRun+767
14CoreFoundation0x000000010cd6fd83CFRunLoopRunSpecific+467
15GraphicsServices0x000000010f42df04GSEventRunModal+161
16UIKit0x000000010d07fe33UIApplicationMain+1010
17YCPai0x000000010a863affmain+111
18libdyld.dylib0x000000010e37c5c9start+1
19???0x00000000000000010x0+1
)
libc++abi.dylib:terminatingwithuncaughtexceptionoftypeNSException
Messagefromdebugger:Terminatedduetosignal6
倚天杖
浏览 325回答 2
2回答

杨魅力

AutoLayoutstillrequiredafterexecuting-layoutSubviews.UITextField'simplementationof-layoutSubviewsneedstocallsuper.光看错误信息的话你应该是-(void)layoutSubviews{//[superlayoutSubviews];缺少这一行代码}
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript