我对离子反应,电容器和Xcode都很陌生。在我的项目中,我在Google Map组件上有一个按钮,当我在浏览器中使用localhost时,该按钮显示得很好,但是当我部署该应用程序并使用电容器和Xcode对它进行仿真时,它不会显示。我尝试使用不同的z索引,但似乎没有什么不同。
与我使用的第三方库google-map-react有关系吗?
这是我渲染的:
render() {
return (
<div style={{ height: "100%", width: "100%" }}>
<GoogleMapReact
bootstrapURLKeys={{ key: "myAPIkey" }}
defaultCenter={this.props.center}
center={this.state.center}
options={this.createMapOptions}
onChange={this._onChange}
defaultZoom={this.props.zoom}
yesIWantToUseGoogleMapApiInternals
onGoogleApiLoaded={({ map, maps }) => {
this.apiIsLoaded(map, maps);
}}
>
</GoogleMapReact>
<IonButton fill="clear" className="center-btn" onClick={()=>{this.setCenter()}}>
<IonIcon color="secondary" slot="icon-only" icon={navigateCircleSharp}></IonIcon></IonButton>
</div>
这是我的CSS样式:
.center-btn{
position: fixed;
z-index: inherit;
height: fit-content;
width: fit-content;
right: 0em;
bottom: 3em;
font-size: 2em;
}