Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 图像中的图像组件未完全拉伸 返回( {this.state.textintal} )_React Native - Fatal编程技术网

React native 图像中的图像组件未完全拉伸 返回( {this.state.textintal} )

React native 图像中的图像组件未完全拉伸 返回( {this.state.textintal} ),react-native,React Native,您可以看到书中的可触摸不透明度,并且组件的高度很好,但宽度没有完全拉伸,我已尝试更改resize mode属性的所有枚举值,但似乎没有任何效果尝试设置imageStyle return( <TouchableOpacity style={{flex:1,justifyContent:'center',backgroundColor:'transparent',flexDirection:'column',...this.props.style}} > <ImageBackgr

您可以看到书中的可触摸不透明度,并且组件的高度很好,但宽度没有完全拉伸,我已尝试更改resize mode属性的所有枚举值,但似乎没有任何效果尝试设置imageStyle

return(

<TouchableOpacity style={{flex:1,justifyContent:'center',backgroundColor:'transparent',flexDirection:'column',...this.props.style}}
>
<ImageBackground
  source={this.state.backimage}

resizeMode={'cover'}
style={{ flex: 1,
    width: '100%',
    height: '100%',

    justifyContent:'center'}}

>

<Text  ref={this.textref}style={{color:this.state.textcolor,position:'absolute',alignSelf:'center',fontSize:this.props.fontSize,fontWeight:this.props.fontWeight}}>{this.state.textintial}</Text>
</ImageBackground>

</TouchableOpacity>

)

尝试设置imageStyle

return(

<TouchableOpacity style={{flex:1,justifyContent:'center',backgroundColor:'transparent',flexDirection:'column',...this.props.style}}
>
<ImageBackground
  source={this.state.backimage}

resizeMode={'cover'}
style={{ flex: 1,
    width: '100%',
    height: '100%',

    justifyContent:'center'}}

>

<Text  ref={this.textref}style={{color:this.state.textcolor,position:'absolute',alignSelf:'center',fontSize:this.props.fontSize,fontWeight:this.props.fontWeight}}>{this.state.textintial}</Text>
</ImageBackground>

</TouchableOpacity>

)


你能分享一下你是如何定义这个.props.style的吗?这将是我要寻找的地方。你能分享一下你如何定义
…这个.props.style
?这将是我要去看的地方。