在Ionic2中,我的标签没有显示

时间:2016-11-02 11:18:47

标签: ionic2

我试图在Android上显示标签但未显示

它显示在网页上

问题在哪里

我的代码是 - >

  

html部分:

  <ion-tabs>
<ion-tab tabIcon="water" tabTitle="Water" [root]="Tabroot1"></ion-tab>
<ion-tab tabIcon="leaf" tabTitle="Life" [root]="Tabroot2"></ion-tab>
<ion-tab tabIcon="flame" tabTitle="Fire" [root]="Tabroot3"></ion-tab>
<ion-tab tabIcon="magnet" tabTitle="Force" [root]="Tabroot4"></ion-tab>
</ion-tabs>
  

typscript part

import {Component} from '@angular/core';

import {NavController} from 'ionic-angular';

import {IsimPage} from '../game/isim/isim';  
import {SehirPage} from '../game/sehir/sehir';
import {HayvanPage} from '../game/hayvan/hayvan';
import {BitkiPage} from '../game/bitki/bitki';
 @Component({
  selector:'page-yeniOyun',
  templateUrl:'yeniOyun.html'
})
export class YeniOyunPage{
Tabroot1: any
Tabroot2: any
Tabroot3: any
Tabroot4: any
constructor(public naVCtrl: NavController){
    this.Tabroot1 = IsimPage;
    this.Tabroot2 = SehirPage;
    this.Tabroot3 = HayvanPage;
    this.Tabroot4 = BitkiPage;
 }
}

1 个答案:

答案 0 :(得分:0)

谢谢' Dag '。我以不同的方式解决了问题,解决了我的离子html结构。 Typescipt part和html part true,错误是我的标签页

  

html部分:

<ion-tabs>
 <ion-tab tabIcon="water" tabTitle="Water" [root]="Tabroot1"></ion-tab>
 <ion-tab tabIcon="leaf" tabTitle="Life" [root]="Tabroot2"></ion-tab> 
 <ion-tab tabIcon="flame" tabTitle="Fire" [root]="Tabroot3"></ion-tab>
 <ion-tab tabIcon="magnet" tabTitle="Force" [root]="Tabroot4"></ion-tab>

  

打字稿部分

import {Component} from '@angular/core';

import {NavController} from 'ionic-angular';

import {IsimPage} from '../game/isim/isim';  
import {SehirPage} from '../game/sehir/sehir';
import {HayvanPage} from '../game/hayvan/hayvan';
import {BitkiPage} from '../game/bitki/bitki';
@Component({
 selector:'page-yeniOyun',
 templateUrl:'yeniOyun.html'
})
export class YeniOyunPage{
Tabroot1: any
Tabroot2: any
Tabroot3: any
Tabroot4: any
constructor(public naVCtrl: NavController){
  this.Tabroot1 = IsimPage;
  this.Tabroot2 = SehirPage;
  this.Tabroot3 = HayvanPage;
  this.Tabroot4 = BitkiPage;
 }
}
  

IsimPage:

 <ion-header>
  <ion-navbar>
 <ion-title>
    IsimPage
 </ion-title>
</ion-navbar>
</ion-header>
  <ion-content padding>
   //Mytab interface here
  </ion-content>
  

SehirPage:

 <ion-header>
  <ion-navbar>
 <ion-title>
    SehirPage
 </ion-title>
</ion-navbar>
</ion-header>
  <ion-content padding>
   //Mytab interface here
  </ion-content>
  

HayvanPage:

 <ion-header>
  <ion-navbar>
 <ion-title>
    HayvanPage
 </ion-title>
</ion-navbar>
</ion-header>
  <ion-content padding>
   //Mytab interface here
  </ion-content>
  

BitkiPage:

 <ion-header>
  <ion-navbar>
 <ion-title>
    BitkiPge
 </ion-title>
</ion-navbar>
</ion-header>
  <ion-content padding>
   //Mytab interface here
  </ion-content>