加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angular – 隐藏Ionic 2中子页面中的选项卡[复制]

发布时间:2020-12-17 18:02:35 所属栏目:安全 来源:网络整理
导读:参见英文答案 How to keep tab when pushing a new page?????????????????????????????????????1个 我尝试在我的应用中隐藏所有子页面上的标签. 我用这个: ion-tab [root]="MyPage" tabsHideOnSubPages="true" .../ion-tab 当我运行离子发球;这是工作. 但是
参见英文答案 > How to keep tab when pushing a new page?????????????????????????????????????1个
我尝试在我的应用中隐藏所有子页面上的标签.
我用这个:

<ion-tab [root]="MyPage" tabsHideOnSubPages="true" ...></ion-tab>

当我运行离子发球;这是工作.
但是当我尝试在我的设备上运行它时,我的标签不会隐藏在子页面中,我也无法使用它.

有人有想法最终隐藏我的设备中的标签?

[更新]
在我的子页面中,我有一个谷歌地图.如果我删除它,我就不再有问题了.

子页面.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,'camera': {
        'latLng': location,'tilt': 30,'zoom': 15,'bearing': 50
      }
    });

    this.map.on(GoogleMapsEvent.MAP_READY).subscribe(() => {
      console.log('Map is ready!');
    });
  }
}

我真的需要一张地图.有人已经有这个问题吗?

解决方法

您还可以尝试在app.module.ts文件中设置tabsHideOnSubPages配置属性,如下所示:

... 
imports: [
    IonicModule.forRoot(MyApp,{
        // Tabs config
        tabsHideOnSubPages: true,...
    })
]
...

从Ionic docs开始:

tabsHideOnSubPages: boolean

Whether to hide the tabs on child pages or not. If true it will not show the tabs on child pages.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读