【发布时间】:2018-04-28 07:33:44
【问题描述】:
我制作了一个带有图标的侧边菜单,并添加了一个活动类来更改所选页面的颜色。
一切正常,只是在 iOS 和 android 上有这个黑色下划线或图标有点太大。我是 ionic 新手,正在学习中,但这个小问题让我很烦。我想我要让 iOS 和 android 上的图标小一点才能正常工作?
任何帮助将不胜感激。
App.html
<ion-content>
<ion-list>
<button ion-item *ngFor="let p of pages" (click)="openPage(p)" [color]="p.color">
<ion-icon item-start [name]="p.icon" ></ion-icon>
{{p.title}}
</button>
</ion-list>
App.component.ts
openPage(page) {
// close the menu when clicking a link from the menu
this.menu.close();
// navigate to the new page if it is not the current page
this.nav.setRoot(page.component);
// Color for the active item
page.color='dark';
for (let p of this.pages) {
if(p.title==page.title){
p.color='dark';
}else{
p.color='';
}
}
【问题讨论】:
标签: angular ionic-framework ionic3