React Native标头损坏

时间:2019-01-23 21:03:03

标签: javascript react-native

React Native应用程序的标题显示不正确。更新<result> <fields> <name>field1</name> <referenceTo>otherPlaceXYZ</referenceTo> </fields> <fields> <name>field3</name> <referenceTo>otherPlaceABC</referenceTo> </fields> <name>CoolName</name> <label>A label</label> </result> 之后,它就崩溃了。

package.json

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">

    <!--Identity template to copy all content by default-->
    <xsl:template match="node()|@*">
        <xsl:copy>
            <xsl:apply-templates select="node()|@*"/>
        </xsl:copy>
    </xsl:template>


    <xsl:template match="fields[not(type='reference')]"/>

</xsl:stylesheet>

主屏幕

react-navigation

enter image description here

  "dependencies": {
    "@expo/samples": "2.1.1",
    "expo": "^31.0.2",
    "react": "16.5.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-31.0.0.tar.gz",
    "react-native-elements": "^0.19.1",
    "react-navigation": "^3.0.9",
    "react-redux": "^6.0.0",
    "redux": "^4.0.1"
  },
  "devDependencies": {
    "babel-preset-expo": "^5.0.0",
    "jest-expo": "^31.0.0"
  }

1 个答案:

答案 0 :(得分:0)

我已经这样使用

initialRouteName: 'TaskList',
        headerMode: 'float',
        navigationOptions: {
            headerRight: <SettingButton/>, // this is class base component 
            headerTintColor: '#333333',
            headerTitle: <LogoTitle/>, // this is class base component
            headerStyle: {
                backgroundColor: '#F5FCFF',
                borderBottomWidth: 0,
            }
        }

在SettingButton和LogoTitle中,您可以定义自定义标题的图标和设计,也可以使用图像。