Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

For iOS like android CoordinatorLayout

Tags:

ios

swift

There is any lib or tutorial for iOS like android CoordinatorLayout with custom behavior. Actually I want is appbar scrolling view behaviour in iOS.

The Header is move to navbar after scrolling

enter image description here

like image 677
Jack Avatar asked Jul 26 '16 11:07

Jack


1 Answers

This is call parallax view controller.

You can use this library - https://github.com/Vinodh-G/ParallaxTableViewHeader

It is really very good library.

It is able to integrate in swift.

Swift code

let headerView : ParallaxHeaderView = ParallaxHeaderView.parallaxHeaderViewWithImage(UIImage(named: ""), forSize: CGSizeMake(self.tableView.frame.size.height, headerHeight)) as! ParallaxHeaderView

self.tableView.tableHeaderView = headerView

func  scrollViewDidScroll(scrollView: UIScrollView) {

    let header: ParallaxHeaderView = self.tableView.tableHeaderView as! ParallaxHeaderView
    header.layoutHeaderViewForScrollViewOffset(scrollView.contentOffset)

    self.tblHealthData.tableHeaderView = header

}

Addtion

There is vertical scrolling segmentation control.

You can easily integrate with https://github.com/HighBay/PageMenu

Just understand 1,thing vertical scrolling segmentation no of controls have only 1 table view.

And you have to add parallax view controller on table view header.

All the best.

like image 51
Hasya Avatar answered Oct 21 '22 14:10

Hasya