mirror of
https://github.com/material-components/material-components-ios.git
synced 2026-01-21 12:33:23 +08:00
Kokoro's Bazel version has been increased from 0.11.0 to 0.20.0 As part of this change, the `.kokoro` bazel header rewrite phase's rewrites for MDF libraries has been made less generic because MDFInternationalization can now be imported using framework-style imports as expected. MDFTextAccessibility does not yet have this functionality, so we still need to rewrite it. Version changes in the bazel workspace: - bazelbuild/rules_apple has been increased from 0.3.0 to 0.9.0 - bazel_skylib has been increased from 0.2.0 to 0.6.0 - bazelbuild/rules_swift has been added at 0.4.0 - xctestrunner has been increased from 0.2.1 to 0.2.5 - material_internationalization_ios has been increased from v1.0.4 to v2.0.1 - material_text_accessibility_ios has been increased from fd570d71ae0124c75ad5af00e6b8b4b1668d5e40 to v2.0.0 - motion_interchange_objc has been increased from v1.6.0 to v2.0.0 - motion_animator_objc has been increased from v2.5.0 to v3.0.0 - motion_transitioning_objc has been increased from v5.0.0 to v6.0.0 - Swift version has been pinned to 3 for all swift libraries. buildifier was ran on all affected build targets. This unblocks https://github.com/material-components/material-components-ios/pull/5550.
Header stack view
The header stack view component is a view that coordinates the layout of two vertically stacked bar views.
Design & API Documentation
Installation
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;
