Merge pull request #87 from substantial/add-back-font-scaling

iOS Accessibility - add headerBackAllowFontScaling option
This commit is contained in:
Brent Vatne 2019-02-20 12:47:13 -08:00 committed by GitHub
commit 77d95131a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -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}

View File

@ -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>