diff --git a/Example/MXSegmentedPager/Base.lproj/Main_iPhone.storyboard b/Example/MXSegmentedPager/Base.lproj/Main_iPhone.storyboard index cacddad3b..2d31427e3 100644 --- a/Example/MXSegmentedPager/Base.lproj/Main_iPhone.storyboard +++ b/Example/MXSegmentedPager/Base.lproj/Main_iPhone.storyboard @@ -1,46 +1,44 @@ - + - - + + - - - + + + - - + + - + - + - + - + - - + + - - - + - + - + diff --git a/Example/MXSegmentedPager/MXMenuViewController.m b/Example/MXSegmentedPager/MXMenuViewController.m index 237c1d1d9..b11481372 100644 --- a/Example/MXSegmentedPager/MXMenuViewController.m +++ b/Example/MXSegmentedPager/MXMenuViewController.m @@ -32,6 +32,14 @@ @interface MXMenuViewController () @implementation MXMenuViewController +- (void)viewDidLoad { + [super viewDidLoad]; + + [self.navigationController.navigationBar setBackgroundImage:[UIImage new] + forBarMetrics:UIBarMetricsDefault]; + self.navigationController.navigationBar.shadowImage = [UIImage new]; +} + #pragma -mark - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { diff --git a/Example/MXSegmentedPager/MXParallaxViewController.m b/Example/MXSegmentedPager/MXParallaxViewController.m index 46e372949..1948aac07 100644 --- a/Example/MXSegmentedPager/MXParallaxViewController.m +++ b/Example/MXSegmentedPager/MXParallaxViewController.m @@ -23,9 +23,7 @@ - (void)viewDidLoad { [super viewDidLoad]; - [self.navigationController.navigationBar setBackgroundImage:[UIImage new] - forBarMetrics:UIBarMetricsDefault]; - self.navigationController.navigationBar.shadowImage = [UIImage new]; + self.navigationController.navigationBar.translucent = YES; self.automaticallyAdjustsScrollViewInsets = NO; // Setup the segmented pager properties diff --git a/Example/MXSegmentedPager/MXSimpleViewController.m b/Example/MXSegmentedPager/MXSimpleViewController.m index dde348e96..9131b3948 100644 --- a/Example/MXSegmentedPager/MXSimpleViewController.m +++ b/Example/MXSegmentedPager/MXSimpleViewController.m @@ -24,7 +24,6 @@ #import "MXSegmentedPager.h" @interface MXSimpleViewController () -@property (nonatomic, strong) UIImageView * cover; @property (nonatomic, strong) MXSegmentedPager * segmentedPager; @property (nonatomic, strong) UITableView * tableView; @property (nonatomic, strong) UIWebView * webView; @@ -37,7 +36,7 @@ - (void)viewDidLoad { [super viewDidLoad]; - [self.view addSubview:self.cover]; + self.navigationController.navigationBar.translucent = NO; // Setup the segmented pager properties self.segmentedPager.delegate = self; @@ -46,36 +45,16 @@ - (void)viewDidLoad [self.view addSubview:self.segmentedPager]; } -#pragma -mark private methods - -- (UIImageView *)cover { - if (!_cover) { - // Boundary between cover and segmented pager - CGFloat boundary = self.view.frame.size.height / 3; - - // Set a cover on the top of the view - _cover = [[UIImageView alloc] initWithFrame:(CGRect){ - .origin = CGPointZero, - .size.width = self.view.frame.size.width, - .size.height = boundary - }]; - _cover.contentMode = UIViewContentModeScaleAspectFill; - _cover.image = [UIImage imageNamed:@"success-baby"]; - } - return _cover; -} +#pragma -mark Properties - (MXSegmentedPager *)segmentedPager { if (!_segmentedPager) { - // Boundary between cover and segmented pager - CGFloat boundary = self.view.frame.size.height / 3; - // Set a segmented pager below the cover + // Set a segmented pager _segmentedPager = [[MXSegmentedPager alloc] initWithFrame:(CGRect){ - .origin.x = 0, - .origin.y = boundary, + .origin = CGPointZero, .size.width = self.view.frame.size.width, - .size.height = 2 * boundary + .size.height = self.view.frame.size.height - 64.f }]; } return _segmentedPager; @@ -123,6 +102,7 @@ - (UITextView *)textView { } #pragma -mark + - (NSInteger)numberOfPagesInSegmentedPager:(MXSegmentedPager *)segmentedPager { return 3; } @@ -136,6 +116,7 @@ - (UIView *)segmentedPager:(MXSegmentedPager *)segmentedPager viewForPageAtIndex } #pragma -mark + - (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 50; } @@ -146,6 +127,7 @@ - (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPat } #pragma -mark + -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; diff --git a/Example/ParallaxView.gif b/Example/ParallaxView.gif new file mode 100644 index 000000000..72809a190 Binary files /dev/null and b/Example/ParallaxView.gif differ diff --git a/Example/SimpleView.gif b/Example/SimpleView.gif new file mode 100644 index 000000000..66fa5cb00 Binary files /dev/null and b/Example/SimpleView.gif differ