Code Monkey home page Code Monkey logo

supheaderview's Introduction

SUPHeaderView

Version License Platform

Demo

ExpandableHeaderView

Description

MEExpandableHeaderView without pages & with alternative collapsed mode content. Almost completely redone fork of https://github.com/microeditionbiz/ExpandableHeaderView

SUPHeaderView's goal is to provide a nice header for User Profile with Media/Content presented in UITableView. It reproduces the behaviour that you can find in Twitter's profile section, when the user scrolls down that section and the header is expanded and blurred, or when user scrolls up and header collapses and shows minimum info with smaller UI.

Usage

First create SUPHeaderView with valid sizes:

  _headerView = [[SUPHeaderView alloc] initWithFullsizeHeight:140 shrinkedHeight:60];
  _headerView.backgroundView.image = [UIImage imageNamed:@"someImage"];

To add content into fullsize mode of the headerView - use:

  _headerView.fullsizeContentView

For shrinked:

  _headerView.shrinkedContentView 

You can use onLayout() block property to customize layout of your views within fullsizeContentView and shrinkedContentView. After initializing SUPHeaderView with content and custom layout - set it's frame to trigger initial layout. After that all you need to do is to integrate it into your tableView, but implementing following methods:

  - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
  {
    return _headerView;
  }


  - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
  {
    return self.headerView.frame.size.height;
  }

  - (void)scrollViewDidScroll:(UIScrollView *)scrollView
  {
    [self.headerView tableView:self.tableView didUpdateContentOffset:scrollView.contentOffset];
  }

Requirements

UIKit, Accelerate, iOS >= 8

Installation

SUPHeaderView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "SUPHeaderView"

License

SUPHeaderView is available under the MIT license. See the LICENSE file for more info.

supheaderview's People

Contributors

microeditionbiz avatar psineur avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.