Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7bcdb25

Browse files
Merge pull request #106 from charpeni/fix-100
Add titleStyle to route props
2 parents 8dd87a1 + 0b25f86 commit 7bcdb25

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ The **`this.props.toRoute()`** callback prop takes one parameter (a JavaScript o
132132
- `rightCorner`: Specify a component to render on the right side of the navigation bar
133133
- `titleComponent`: Specify a component to replace the title. This could for example be your logo (as in the first page of the Instagram app)
134134
- `headerStyle`: Change the style of your header for the new route. You could for example specify a new backgroundColor and the router will automatically make a nice transition from one color to the other!
135+
- `titleStyle`: Apply a StyleSheet to the navigation bar titles. Useful for changing the font or text color.
135136
- `passProps`: Takes in an object. Passes each `key: value` pair to your component as a prop. i.e. <Component key={value} />
136137
- `trans`: If set to a truthy value it will make the navbar transparent and move your component content so that it sits behind the nav.
137138
- `noStatusBar`: If hiding the navigationbar using `hideNavigationBar` you must set this option to true to not reserve the space on the top of the UI

‎components/NavBarContent.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,13 @@ class NavBarContent extends React.Component {
237237
);
238238
} else {
239239
titleContent = (
240-
<Text style={[styles.navbarText, this.props.titleStyle]} numberOfLines={1}>
240+
<Text style={[
241+
styles.navbarText,
242+
this.props.titleStyle,
243+
this.props.route.titleStyle,
244+
]}
245+
numberOfLines={1}
246+
>
241247
{this.props.route.name}
242248
</Text>
243249
);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /