FIXED: incorrect view hierarchy update

This commit is contained in:
Didier Korthoudt committed 2016-01-20 23:50:22 +01:00
1 parent 4482089712
commit 3411c340ab
1 file changed
+4 -2
+4 -2
View File
@@ -618,8 +618,10 @@ var CPBoxTypeKey = @"CPBoxTypeKey",
if (_boxType != CPBoxSeparator)
{
_contentView = [aCoder decodeObjectForKey:CPBoxContentView] || [[CPView alloc] initWithFrame:[self bounds]];
[self replaceSubview:[self subviews][0] with:_contentView];
_contentView = [aCoder decodeObjectForKey:CPBoxContentView] || [[CPView alloc] initWithFrame:[self bounds]];
var malformedContentView = [self subviews][0];
[_contentView setSubviews:[malformedContentView subviews]];
[self replaceSubview:malformedContentView with:_contentView];
}
[self setAutoresizesSubviews:YES];