【发布时间】:2017-08-03 16:24:30
【问题描述】:
我尝试在我的应用程序的所有子页面上隐藏标签。 我用这个:
<ion-tab [root]="MyPage" tabsHideOnSubPages="true" ...></ion-tab>
当我运行 ionic serve 时;是工作。 但是当我尝试在我的设备上运行它时,我的标签没有隐藏在子页面中,我无法使用它。
有人想最终将我的标签隐藏在我的设备中吗?
[更新] 在我的子页面中,我有一个谷歌地图。如果我删除它,我就没有我的问题了。
子页面.html:
<ion-header>
<c-header></c-header>
</ion-header>
<ion-content>
<div id="map"></div>
</ion-content>
子页面.css:
#map {
height: 50%;
}
子页面.ts:
import { Component } from '@angular/core';
import { NavController, Platform } from 'ionic-angular';
import { GoogleMap, GoogleMapsEvent, GoogleMapsLatLng } from 'ionic-native';
/*
Generated class for the DetailsMedicalEvent page.
See http://ionicframework.com/docs/v2/components/#navigation for more info on
Ionic pages and navigation.
*/
@Component({
selector: 'page-details-medical-event',
templateUrl: 'details-medical-event.html'
})
export class DetailsMedicalEventPage {
map: GoogleMap;
constructor(public navCtrl: NavController, public platform: Platform) {
platform.ready().then(() => {
this.loadMap();
});
}
loadMap(){
let location = new GoogleMapsLatLng(-34.9290,138.6010);
this.map = new GoogleMap('map', {
'backgroundColor': 'white',
'controls': {
'compass': true,
'myLocationButton': true,
'indoorPicker': true,
'zoom': true
},
'gestures': {
'scroll': true,
'tilt': true,
'rotate': true,
'zoom': true
},
'camera': {
'latLng': location,
'tilt': 30,
'zoom': 15,
'bearing': 50
}
});
this.map.on(GoogleMapsEvent.MAP_READY).subscribe(() => {
console.log('Map is ready!');
});
}
}
我真的需要一张地图。有人已经有这个问题了吗?
【问题讨论】:
-
你的离子版本是什么?在你的 package.json
-
你想看什么?我有 '"@ionic/app-scripts": "1.1.4"' ?
-
好的..我想知道您是否使用的是旧版本的
ionic-angular。我正在使用相同的代码,它可以工作 -
我使用 "ionic-angular": "2.2.0"
-
您测试了哪种设备?
标签: angular typescript ionic-framework ionic2 ionic3