typescript 如何在ionic 2中使图标和按钮变大
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43292060/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to make icons and buttons bigger in ionic 2
提问by RSA
How can make button
and icon
size bigger in fallowing code:
如何在空闲代码中使button
和icon
大小变大:
<ion-card>
<ion-card-header>
Explore Nearby
</ion-card-header>
<ion-list>
<button ion-item>
<ion-icon name="cart" item-left></ion-icon>
Shopping
</button>
<button ion-item>
<ion-icon name="medical" item-left></ion-icon>
Hospital
</button>
<button ion-item>
<ion-icon name="cafe" item-left></ion-icon>
Cafe
</button>
</ion-list>
</ion-card>
回答by Deanmv
Icons
图标
ion-icon
s are font icons so they can be edited the following Sass/CSS as they are essentially text:
ion-icon
s 是字体图标,因此可以在以下 Sass/CSS 中编辑它们,因为它们本质上是文本:
ion-icon {
font-size: 20px; //Preferred size here
}
Buttons
纽扣
As for the button
ionic has some inbuilt classes to affect size. For example:
至于button
ionic 有一些内置类来影响大小。例如:
<button ion-button large>Large</button>
<button ion-button>Default</button>
<button ion-button small>Small</button>
You can also update the default Sass variable of $button-round-padding
in your src/theme/variables.scss
file, to the size that you would like. More on buttons can be found here
您还可以$button-round-padding
将src/theme/variables.scss
文件中的默认 Sass 变量更新为您想要的大小。可以在此处找到有关按钮的更多信息
回答by Prashant
Even for Icon we can use large and small to the ion-icon tag. This is how I had used
即使对于 Icon ,我们也可以对 ion-icon 标签使用大号和小号。这是我如何使用
<ion-icon name="arrow-forward" item-end small></ion-icon>
<ion-icon name="arrow-forward" item-end small></ion-icon>
回答by Nowdeen
In my Ionic 4 apps I adopted the following approach. In the *.scss file:
在我的 Ionic 4 应用程序中,我采用了以下方法。在 *.scss 文件中:
ion-icon { zoom: 1.5 }
Of course, zoom value depend on your needs.
Hope this help someone. o/
当然,缩放值取决于您的需要。
希望这有助于某人。o/