簡體   English   中英

反應本機導航標題溢出

[英]React Native Navigation Header Overflow

我試圖通過設置headerTitle: <CustomHeader />react-navigation創建自定義標題,但自定義標題溢出屏幕。 這是 iOS 和 Android 上的預覽

這是我的標記:

<View style={styles.container}>
    <View style={styles.textContainer}>
        <Text style={styles.description}>Welcome to</Text>
        <Text style={styles.title}>Testing</Text>
    </View>
    <View>
        <Icon name="basket" color={globalStyles.colors.PRIMARY} size={24} />
    </View>
</View>

這是我的風格

container: {
    height: "100%",
    width: "100%",
    flexDirection: "row",
    alignItems: "center",
    justifyContent: "space-between"
},
textContainer: {
    height: "100%",
    flexDirection: "column",
    alignItems: "flex-start",
    justifyContent: "center"
},
basketContainer: {
    height: "100%",
    flexDirection: "row",
    alignItems: "flex-start",
    justifyContent: "flex-start"
}

它實際上在做我想做的事,只是籃子圖標越過了屏幕邊緣

嘗試將flex: 1添加到您的textContainer樣式。 還嘗試為圖標的視圖容器指定寬度。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM