mirror of
https://github.com/material-components/material-components-ios.git
synced 2026-02-11 05:54:20 +08:00
We can credit any contributor who would like to be credited this way, by adding them on request to the AUTHORS file. The copyright statement changes are required for this to work. Note that this has... Summary: We can credit any contributor who would like to be credited this way, by adding them on request to the AUTHORS file. The copyright statement changes are required for this to work. Note that this has no legal change, since the contributors always retained their copyright despite the copyright notice, but it's a nice acknowledgement. Changed copyright statement to include non-Google authors. Command run: find * \( -name '*\.m' -or -name '*\.h' -or -name '*\.swift' \) -and -not \( -path 'scripts/external*' -name Pods \) -print0 | xargs -0 sed -i '' 's/Copyright \(.*\) Google Inc/Copyright \1 the Material Components for iOS authors/' Added non-source files. Command run: grep -Rl 'Copyright .* Google Inc' * --exclude-dir scripts/external --null | xargs -0 sed -i '' 's/Copyright \(.*\) Google Inc/Copyright \1 the Material Components for iOS authors/' Reviewers: featherless, O1 Material components iOS, randallli Reviewed By: O1 Material components iOS, randallli Tags: #material_components_ios Differential Revision: http://codereview.cc/D1415
| title | layout | section | excerpt |
|---|---|---|---|
| Header Stack View | detail | components | The Header Stack View component is a view that coordinates the layout of two vertically stacked bar views. |
Header Stack View
[](docs/assets/header_stack_view.mp4)
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:
Objective-C
#import "MaterialHeaderStackView.h"
Swift
import MaterialComponents
Header Stack View provides MDCHeaderStackView, which is a UIView subclass.
Objective-C
MDCHeaderStackView *headerStackView = [[MDCHeaderStackView alloc] init];
Swift
let headerStackView = MDCHeaderStackView()
You may provide a top bar:
Objective-C
headerStackView.topBar = navigationBar;
Swift
headerStackView.topBar = navigationBar
You may provide a bottom bar:
Objective-C
headerStackView.bottomBar = tabBar;
Swift
headerStackView.bottomBar = tabBar