0

i want to extended navigation like android Android Material extended toolbar when scroll up

enter image description here

first i create header with 240 high add on it UILabel at high 24 and UIImageView for my UITableView

i overrided scrollViewDidScroll

  func scrollViewDidScroll(scrollView: UIScrollView) {


    self.automaticallyAdjustsScrollViewInsets = false

    let offsetY = scrollView.contentOffset.y

    if offsetY > myHeader - myLableY{
        print(offsetY)
        self.navTitle.text = "My App Name"


    }else{

        self.navTitle.text = ""

    }



}

but i face two problem

1- if number of cells item on uitableview is fewer, can't scroll top of view to change navbar title

2- second when scroll down it show white space i want to tableview head to be parallax

Ahmed Wahdan
  • 330
  • 4
  • 15
  • The thing you are seeing is not a navigation bar that is extending, it is the header view of the table that is customising its frame. See the scroll bar on the right side when u do scroll the table view. – Teja Nandamuri Mar 18 '16 at 15:25
  • what's happening is when you start scrolling, you are hiding the nav bar title and making the ceontent on header view appear larger by fading it in, and do the reverse for collapse action. – Teja Nandamuri Mar 18 '16 at 15:26
  • i dont have idea how to create extend navigation bar , so i try to use uitableview header to do this , i but this code to show my solution but i get problem with this solution. – Ahmed Wahdan Mar 18 '16 at 15:28
  • i have UILabel and UIImage on uitableview header it's display app name and app logo but in large size ,header height is 240 – Ahmed Wahdan Mar 18 '16 at 15:30
  • You can refer to [iOS 11 navigation bar height customizing](https://stackoverflow.com/questions/44387285/ios-11-navigation-bar-height-customizing) – Wei Dec 27 '18 at 03:34

0 Answers0