Skip to content

Commit 51d1636

Browse files
committed
Merge pull request weissi#31 from sptramer/feature-autosize
[FEATURE] Added 'autosizeContent' to FRLayeredNavigationItem
2 parents 388b87b + 18cf6fc commit 51d1636

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

FRLayeredNavigationController/FRLayerController.m

+3-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ - (void)doViewLayout
116116
if (self.layeredNavigationItem.hasBorder) {
117117
self.borderView.frame = borderFrame;
118118
}
119-
self.contentView.frame = contentFrame;
119+
if (self.layeredNavigationItem.autosizeContent) {
120+
self.contentView.frame = contentFrame;
121+
}
120122
}
121123

122124

FRLayeredNavigationController/FRLayeredNavigationItem.h

+6
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
BOOL _hasChrome;
4949
BOOL _hasBorder;
5050
BOOL _displayShadow;
51+
BOOL _autosizeContent;
5152
FRLayerController __weak * _layerController;
5253
}
5354

@@ -102,6 +103,11 @@
102103
*/
103104
@property (nonatomic, readwrite) BOOL displayShadow;
104105

106+
/**
107+
* If the view should automatically size its content to the layer size
108+
*/
109+
@property (nonatomic, readwrite) BOOL autosizeContent;
110+
105111
/**
106112
* A custom bar button item displayed on the left of the navigation bar.
107113
*/

FRLayeredNavigationController/FRLayeredNavigationItem.m

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ - (id)init
5050
self->_hasChrome = YES;
5151
self->_displayShadow = YES;
5252
self->_hasBorder = YES;
53+
self->_autosizeContent = YES;
5354
}
5455

5556
return self;
@@ -86,6 +87,7 @@ - (UIBarButtonItem *)rightBarButtonItem
8687
@synthesize hasChrome = _hasChrome;
8788
@synthesize hasBorder = _hasBorder;
8889
@synthesize displayShadow = _displayShadow;
90+
@synthesize autosizeContent = _autosizeContent;
8991
@synthesize layerController = _layerController;
9092

9193
@end

0 commit comments

Comments
 (0)