Imageコンポーネントを囲むImageコンポーネントとTextコンポーネントでViewを作成しようとしています。React-Nativeで画像の周りにテキストを折り返す
マイスタイリング:
textContainer: {
flexDirection: 'row',
},
text: {
flex: 10,
},
image: {
flex:1,
height: 180,
width: 150,
margin: 10,
borderColor: '#ccc',
borderWidth: 1,
}
マイコンポーネント:
<ScrollView style={styles.contentContainer} >
{this.props.content.title_1 ? <Text style={styles.title}>{this.props.content.title_1}</Text> : null}
<View style={styles.textContainer}>
{this.props.content.text_1 ? <Text style={styles.text}>{this.props.content.text_1}</Text> : null}
{this.props.content.image_1 ? <Image width={null} height={null} style={styles.image} source={this.props.content.image_1} /> : null}
</View>
</ScrollView>
これはどのような結果である:の下の画像で
を(がまったく笑ラッピング不可)ここで、私はすぐに小さなイメージをテキストにハッキングしました。しかし、私は誰もが正しい方向に私を助けることができると思います
..テキストの周りにラップさせることはできません!
あなたのフレックス方向が行である場合、それは折り返されません。これと例を見てくださいhttps://github.com/facebook/react-native/issues/1438 –
あなたのコメントをありがとう!しかし、これは私の場合は問題ではない、私はイメージの周りにそれを包みたい。 2番目のスクリーンショットと同様ですが、テキストはその背後にあります。 – Timvp