2016-06-01 7 views
2

내 반응 네이티브 프로젝트에서 안드로이드 맵용으로 만든 범례 스타일을 지정하려고합니다. 올바르게 배치하는 데 어려움을 겪고 있습니다. 전설 콘테이너로 절대 속성을 사용하는 것은 나를 버렸다.반응 네이티브 맵보기에서 legend.png 스타일을 지정하는 방법

screenshot

스타일

container: { 
    flex: 1 
}, 
map: { 
    position: 'absolute', 
    top: 56, 
    left: 0, 
    right: 0, 
    bottom: 0, 
}, 
legendContainer: { 
    position: 'absolute', 
    left: 200, 
    right: 0, 
    bottom: 0, 
    height: 65, 
    width: 210, 
    flex: 1, 
    alignItems: 'center', 
    flexDirection: 'column', 
    justifyContent: 'center', 
    backgroundColor: 'transparent' 
}, 
legend: { 
    top: 0, 
    right: 0, 
    height: 60, 
    width: 180, 
    flexDirection: 'row', 
    resizeMode: 'cover' 
} 

Map.js이

<View style= { styles.container } > 
     <Toolbar 
      title={this.state.selectedTrip.tripName || this.state.selectedTripName} /> 
     <MapView 
      style={styles.map} 
      region={this.state.region} 
      > 
     </MapView> 
     <View style={styles.legendContainer}> 
      <Image source={require('../../img/legend.png') } style={styles.legend}/> 
     </View> 
    </View > 
+0

이미지에 'resizeMode ='contain''을 추가하십시오 : ''스타일이 아닙니다. – Cherniv

+0

awesome! 대답 해주세요. – texas697

답변

관련 문제