2017-07-28 1 views
0

私はGiftedChatをしようとしています:完全witdh、高さ( '反応するネイティブ・才能・チャット' パッケージ)</p> <p>私のコードは、反応するネイティブ(具体的かつGiftedChat)

<View style={styles.container}> 
    <Text style={{width:400}}> 
     Welcome to React Native! {check()} 
    </Text> 
    <GiftedChat 
     style={styles.welcome} 
     messages={this.state.messages} 
     onSend={(messages) => this.onSend(messages)} 
     user={{ 
     _id: 1, 
     }} 
    /> 
    </View> 

const styles:any = StyleSheet.create({ 
    container: { 
    flex: 1, 
    justifyContent: 'center', 
    alignItems: 'center', 
    backgroundColor: '#F5FCFF', 
    }, 
}) 

GiftedChat

なぜGiftedチャットコンポーネントが完全に表示されないのですか?私は間違って何をしていますか?利用可能な画面の幅と高さに合わせるために何をする必要がありますか?確認するには何が必要ですか?

非常に感謝しています。

return (
    <View style={styles.container}> 
    <Text style={{width:400}}> 
     Welcome to React Native! {check()} 
    </Text> 
    <GiftedChat 
     messages={this.state.messages} 
     onSend={(messages) => this.onSend(messages)} 
     user={{ 
     _id: 1, 
     }} 
    /> 
    </View> 
) 

書き込み:

+1

ショーは ' –

+0

は、私が設定してみてくださいstyles.welcome' {幅:400}そのスタイルのために、または全く指定しないでください。これは見方を変えなかった。私はリターンGiftedChatラップされていないソリューションを見つけた。元のコードのようにラッパーで解決する方法が見つかった人がいれば、もう一度答えを書いてください。 – user394010

答えて

0

ノー包まれた容器の代わりとリターンGiftedChatコンポーネント場合、それが働いた

return (
    <GiftedChat 
    messages={this.state.messages} 
    onSend={(messages) => this.onSend(messages)} 
    user={{ 
     _id: 1, 
    }} 
    /> 
)