简体   繁体   English

Ionic 2如何造型 <ion-item> 窗口

[英]Ionic 2 How to style <ion-item> window

So I´ve been trying to style the "" window that pops out whenever I press on it. 因此,我一直试图设置在每次按下时都会弹出的“”窗口的样式。 So my HTML code is this: 所以我的HTML代码是这样的:

 page-about { } 
 <!--HTML about.html --> <ion-item> <ion-label>Toppings</ion-label> <ion-select [(ngModel)]="toppings"> <ion-option>Bacon</ion-option> <ion-option>Black Olives</ion-option> <ion-option>Extra Cheese</ion-option> <ion-option>Mushrooms</ion-option> <ion-option>Pepperoni</ion-option> <ion-option>Sausage</ion-option> </ion-select> </ion-item> 

I kinda want to reduce the width and height of the window that pops out. 我有点想减少弹出窗口的宽度和高度。 Thanks for your help. 谢谢你的帮助。

You can try this 你可以试试这个

<ion-select [(ngModel)]="toppings" class="selectClass">
    <ion-option>Bacon</ion-option>
    <ion-option>Black Olives</ion-option>
    <ion-option>Extra Cheese</ion-option>
    <ion-option>Mushrooms</ion-option>
    <ion-option>Pepperoni</ion-option>
    <ion-option>Sausage</ion-option>
  </ion-select>

In your .sass file add this 在您的.sass文件中添加此

.selectClass {
    max-width:100px !important;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM