Will Larche 3c4e905598 [Readmes] Snippets in Swift 3 (#1039)
* [ActivityIndicator] Snippets in Swift 3

* [AnimationTiming] Snippets in Swift 3.

* [AppBar] Snippets in Swift 3 and corrections to snippets.

* [ButtonBar] Snippets in Swift 3 and corrections to snippets.

* [ButtonBar] Removing TODO.

* [Buttons] Snippets in Swift 3.

* [Collections] Snippets in Swift 3 and snippet corrections.

* [CollectionLayoutAttributes] Snippets in Swift 3.

* [Dialogs] Snippets in Swift 3 and snippets corrections.

* [FeatureHighlight] Snippets in Swift 3 and snippets corrections.

* [FeatureHighlight] Missing import specification.

* [FlexibleHeader] Snippets in Swift 3 and snippet corrections.

* [Dialogs] Corrections to snippets.

* [HeaderStackView] Adding import specifier.

* [Ink] Snippets in Swift 3 and snippets corrections.

* [NavigationBar] Snippets in Swift 3.

* [NavigationBar] Removing TODO.

* [OverlayWindow] Snippets in Swift 3 and snippets corrections.

* [PageControl] Snippets in Swift 3 and snippet corrections.

* [OverlayWindow] Snippets in Swift 3 and snippet corrections.

* [Palettes] Snippets in Swift 3 and snippet corrections..

* [ProgressView] Snippets in Swift 3 and snippet corrections.

* [Readmes] Snippet alignment corrections.
2016-12-13 17:17:57 -05:00
..
2016-12-09 15:59:50 -05:00

Header Stack View

Header Stack View

The Header Stack View component is a view that coordinates the layout of two vertically stacked bar views.

Material Design Specifications

API Documentation


Installation

Requirements

  • Xcode 7.0 or higher.
  • iOS SDK version 7.0 or higher.

Installation with CocoaPods

To add this component to your Xcode project using CocoaPods, add the following to your Podfile:

pod 'MaterialComponents/HeaderStackView'

Then, run the following command:

pod install

Overview

This view's sole purpose is to facilitate the relative layout of two horizontal bars. The bottom bar will bottom align and be of fixed height. The top bar will stretch to fill the remaining space if there is any.

The top bar is typically a navigation bar. The bottom bar, when provided, is typically a tab bar.


Usage

Importing

Before using Header Stack View, you'll need to import it:

Swift

import MaterialComponents.MaterialHeaderStackView

Objective-C

#import "MaterialHeaderStackView.h"

Header Stack View provides MDCHeaderStackView, which is a UIView subclass.

Swift

let headerStackView = MDCHeaderStackView()

Objective-C

MDCHeaderStackView *headerStackView = [[MDCHeaderStackView alloc] init];

You may provide a top bar:

Swift

headerStackView.topBar = navigationBar

Objective-C

headerStackView.topBar = navigationBar;

You may provide a bottom bar:

Swift

headerStackView.bottomBar = tabBar

Objective-C

headerStackView.bottomBar = tabBar;