2016-07-28 124 views
0

我在RTCView中使用视频,我想通过另一个视频显示一个小视频。但是我的RTCView并没有相互重叠。下面是我的代码React-Native RTC视图重叠

<RTCView streamURL={this.state.selfViewSrc} style={styles.selfView}/> 
{ 
    mapHash(this.state.remoteList, function(remote, index) { 
    return <RTCView key={index} streamURL={remote} style= {styles.remoteView}/> 
    }) 
} 

CSS为─

const styles = StyleSheet.create({ 
selfView: { 
    width: width, 
    height: (Platform.OS === 'ios') ? height-80 : height/2+100, 
    alignSelf: 'center', 
    zIndex: 0, 
}, 
remoteView: { 
    position: 'absolute', 
    zIndex: 2, 
    marginTop: (Platform.OS === 'ios') ? -120 : 0, 
    width: 120, 
    height: 120, 
    left: 0, 
    borderWidth: .5, 
    alignSelf: 'flex-start' 
}, 
+0

记住张贴它目前的样子的截图? –

回答

0

我已经解决了这个问题,问题是,在这selfview和远程视窗创建顺序,我要创建远程视图首先把他们战胜自我视图。

谢谢大家!