From b38f20064dcb6161531eb7cbb653642579d917c5 Mon Sep 17 00:00:00 2001 From: Felix Date: Fri, 27 Nov 2015 10:42:20 +0800 Subject: [PATCH 1/2] fix bug for blanks of mutlti sections --- LTNavigationBar/BGColorDemoViewController.m | 4 +++ LTNavigationBar/Base.lproj/Main.storyboard | 36 ++++++++++++++----- .../ScrollingNavbarDemoViewController.m | 11 ++++-- 3 files changed, 41 insertions(+), 10 deletions(-) diff --git a/LTNavigationBar/BGColorDemoViewController.m b/LTNavigationBar/BGColorDemoViewController.m index 32bada3..a34e5cd 100644 --- a/LTNavigationBar/BGColorDemoViewController.m +++ b/LTNavigationBar/BGColorDemoViewController.m @@ -79,6 +79,10 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa return 65; } +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + return @"header"; +} - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; diff --git a/LTNavigationBar/Base.lproj/Main.storyboard b/LTNavigationBar/Base.lproj/Main.storyboard index 83a3a8e..3728f94 100644 --- a/LTNavigationBar/Base.lproj/Main.storyboard +++ b/LTNavigationBar/Base.lproj/Main.storyboard @@ -1,7 +1,8 @@ - + - + + @@ -19,29 +20,38 @@ + + + + + + + @@ -80,6 +90,7 @@ + @@ -97,6 +108,7 @@ + @@ -121,29 +133,38 @@ + + + + + + + @@ -153,7 +174,9 @@ - + + + @@ -175,6 +198,7 @@ + @@ -193,6 +217,7 @@ + @@ -208,9 +233,4 @@ - - - - - diff --git a/LTNavigationBar/ScrollingNavbarDemoViewController.m b/LTNavigationBar/ScrollingNavbarDemoViewController.m index 9fe889e..b907f37 100644 --- a/LTNavigationBar/ScrollingNavbarDemoViewController.m +++ b/LTNavigationBar/ScrollingNavbarDemoViewController.m @@ -29,11 +29,14 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView if (offsetY > 0) { if (offsetY >= 44) { [self setNavigationBarTransformProgress:1]; + scrollView.contentInset = UIEdgeInsetsMake(20, 0, 0, 0); } else { [self setNavigationBarTransformProgress:(offsetY / 44)]; + scrollView.contentInset = UIEdgeInsetsMake(20 + offsetY, 0, 0, 0); } } else { [self setNavigationBarTransformProgress:0]; + scrollView.contentInset = UIEdgeInsetsMake(64, 0, 0, 0); self.navigationController.navigationBar.backIndicatorImage = [UIImage new]; } } @@ -59,12 +62,12 @@ - (void)viewWillDisappear:(BOOL)animated - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return 10; + return 6; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 1; + return 4; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath @@ -80,5 +83,9 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa return 65; } +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + return @"header"; +} @end From b53da562563788df218acae235fbdce1595a853c Mon Sep 17 00:00:00 2001 From: Felix Date: Fri, 27 Nov 2015 10:57:42 +0800 Subject: [PATCH 2/2] add description if readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 22d1aa3..49f4b07 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ ![LTNavigationbar](https://cocoapod-badges.herokuapp.com/v/LTNavigationBar/badge.png) +## Fix Bugs +Delete the blanks of multi sections of table view in "TranslationChangeController.h" + ## Purpose It is hard to change the appearance of UINavigationBar dynamically, so I made this lib to make the job easy.