FIXED: only set a content view of CPBox if it is not a separator

This commit is contained in:
Antoine Mercadal committed 2016-01-19 16:10:31 -08:00
1 parent bf8070c42d
commit 00bdbcf857
1 file changed
+5 -2
+5 -2
View File
@@ -616,8 +616,11 @@ var CPBoxTypeKey = @"CPBoxTypeKey",
_titlePosition = [aCoder decodeIntForKey:CPBoxTitlePosition];
_titleView = [aCoder decodeObjectForKey:CPBoxTitleView] || [CPTextField labelWithTitle:_title];
_contentView = [aCoder decodeObjectForKey:CPBoxContentView] || [[CPView alloc] initWithFrame:[self bounds]];
[self replaceSubview:_contentView with:[self subviews][0]];
if (_boxType != CPBoxSeparator)
{
_contentView = [aCoder decodeObjectForKey:CPBoxContentView] || [[CPView alloc] initWithFrame:[self bounds]];
[self replaceSubview:_contentView with:[self subviews][0]];
}
[self setAutoresizesSubviews:YES];
[_contentView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];