mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-29 04:45:19 +08:00
Merge pull request #87 from substantial/add-back-font-scaling
iOS Accessibility - add headerBackAllowFontScaling option
This commit is contained in:
@@ -214,6 +214,7 @@ class Header extends React.PureComponent {
|
|||||||
title={backButtonTitle}
|
title={backButtonTitle}
|
||||||
truncatedTitle={truncatedBackButtonTitle}
|
truncatedTitle={truncatedBackButtonTitle}
|
||||||
backTitleVisible={this.props.backTitleVisible}
|
backTitleVisible={this.props.backTitleVisible}
|
||||||
|
allowFontScaling={options.headerBackAllowFontScaling}
|
||||||
titleStyle={options.headerBackTitleStyle}
|
titleStyle={options.headerBackTitleStyle}
|
||||||
layoutPreset={this.props.layoutPreset}
|
layoutPreset={this.props.layoutPreset}
|
||||||
width={width}
|
width={width}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class HeaderBackButton extends React.PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_maybeRenderTitle() {
|
_maybeRenderTitle() {
|
||||||
const { backTitleVisible, titleStyle, tintColor } = this.props;
|
const { allowFontScaling, backTitleVisible, titleStyle, tintColor } = this.props;
|
||||||
let backTitleText = this._getTitleText();
|
let backTitleText = this._getTitleText();
|
||||||
|
|
||||||
if (!backTitleVisible || backTitleText === null) {
|
if (!backTitleVisible || backTitleText === null) {
|
||||||
@@ -92,6 +92,7 @@ class HeaderBackButton extends React.PureComponent {
|
|||||||
onLayout={this._onTextLayout}
|
onLayout={this._onTextLayout}
|
||||||
style={[styles.title, !!tintColor && { color: tintColor }, titleStyle]}
|
style={[styles.title, !!tintColor && { color: tintColor }, titleStyle]}
|
||||||
numberOfLines={1}
|
numberOfLines={1}
|
||||||
|
allowFontScaling={!!allowFontScaling}
|
||||||
>
|
>
|
||||||
{this._getTitleText()}
|
{this._getTitleText()}
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
Reference in New Issue
Block a user