```
</View>
<View style={OneTaskStyle.center_l2}>
<Text>{"关注:"+this.props.concernNum}</Text>
<Text>{" 距离:"+(this.props.distance?(this.props.distance>=1000? Math.floor((this.props.distance/1000)/1000)+"km":this.props.distance+"m") :"--")}</Text>
</View>
<View>
</View>
</View>
Pretty sure that putting an <Image /> inside a <Text /> component is an error. If you want them to be side by side, try something like:
<View style={{flexDirection: "row"}}>
<Text>Whatever text here</Text>
<Image source={whateversourcehere />
</View>
if have more than one row it is not ok,it is left and right
You could use flexWrap: "wrap" in the parent View in order to have the overflow mechanics you'd get from inline-block.
React Native doesn't support display: block or display: inline-block, they only support flexbox for layout.
it not work
i add flexwrap it like this:
xxxxxxxxxxxxxxxxxxx
xxx
image
Whatever text here
on platform native style is :
xxxxxxxxxxxxxxxx
xxxxximage
but image is very small
on platform web style is:
xxxxxxxxxxxxxxxxx
xxxxx
image
image size is ok but image is a new line
so a add a style in web html style
div[style*='background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEU']{
display:inline-block;
}
it work on web and native
but i think it is not a good way
how to solve it?
<View style={{flexDirection: "row"}}>
<Text>Whatever text here <Image source{whateversourcehere /></Text>
</View>
Hmm, sadly I'm not really sure how to solve it other than the method that you used. Maybe @necolas has more insight as to what's happening there. Sorry!
This should be fixed in master and available in 0.0.101.
You can also see the fix in the Text example "Inline views": https://necolas.github.io/react-native-web/storybook/
Most helpful comment
You could use
flexWrap: "wrap"in the parent View in order to have the overflow mechanics you'd get from inline-block.React Native doesn't support
display: blockordisplay: inline-block, they only support flexbox for layout.