With the system's Uitextfield, added the constraint, the result 8 above no problem, 7 collapsed, the information is as follows:
Assertion failure in-[uitextfield Layoutsublayersoflayer:],/sourcecache/uikit/uikit-2935.138/uiview.m:8794 2014-11-05 12:54:33.377 wattup[1722:60b] terminating app due to uncaught exception ' Nsinternalinconsistencyexception ', Reason: ' Auto Layout still required after executing-layoutsubviews. Uitextfield ' s implementation of-layoutsubviews needs to call super. '
Words do not say < solution, write the subclass inherit Uitextfield, and then rewrite the following method inside,
-(Instancetype) init
{
if (self = [super init]) {
}
return self;
}
-(void) SetText: (NSString *) text
{
[Super Settext:text];
[Self layoutifneeded];
}
-(void) Setplaceholder: (NSString *) placeholder
{
[Super Setplaceholder:placeholder];
[Self layoutifneeded];
}
-(void) layoutsubviews
{
[Super Layoutsubviews];
}
The specific reason after the analysis came out to write again,
Constraints, in iOS8 no problem, in the iOS7 crash problem, Uitextfield