显示MyLocationButton在安卓系统中不起作用(react-native-maps)

a1o7rhls  于 2022-12-14  发布在  React
关注(0)|答案(1)|浏览(110)

显示MyLocationButton在android中无法工作

<MapView
            style={styles.map}
            region={this.state.initalRegion}
            showsUserLocation={`enter code here`true}
            showsMyLocationButton={true}
    </MapView>
oalqel3c

oalqel3c1#

<View
    style={[styles.container, {paddingTop: this.state.statusBarHeight}]}>
    <MapView
      onMapReady={() => {
          setTimeout(() => this.setState({statusBarHeight: 1}), 500);
          setTimeout(() => this.setState({statusBarHeight: 0}), 750);
      }}

这可能行得通

相关问题