如何调整ion-spinner的大小

huangapple go评论63阅读模式
英文:

How to resize ion-spinner

问题

我在一个 Ionic 应用中使用了 ion-spinner,但在我的情况下,我想要更改旋转器的大小。当我使用自定义 CSS 与默认旋转器一起使用时,调整大小正常工作。但对于 Bubbles、Circles、Dots 旋转器,它不起作用。

CSS

.spinner-large {
  width: 100px;
  height: 100px;
}

HTML

<ion-spinner name="dots" class="spinner-large"></ion-spinner>

如何修复这个问题。

Stackblitz 示例

英文:

I'm using ion-spinner in a ionic application. But im my case i want to change the size of the spinner. When i use custom css with default spinner Resizing works fine. But with Bubbles,Circles, Dots spinners, it doesn't work properly.<br>
CSS

.spinner-large {
  width: 100px;
  height: 100px;
}

HTML

    &lt;ion-spinner name=&quot;dots&quot; class=&quot;spinner-large&quot;&gt;&lt;/ion-spinner&gt;

how can i fix this.

Stackblitz example

答案1

得分: 24

尝试使用

ion-spinner {
    transform: scale(3);
}

从Ionic论坛中提到,这将使您失去一些分辨率。

英文:

Try using

ion-spinner {
    transform: scale(3);
}

From ionic forum its mentioned that this will make you loose some resolution.

答案2

得分: 6

ion-spinner {
  width: 3em;
  height: 3em;
}

https://github.com/ionic-team/ionic-framework/issues/18115

英文:

As Ionic 4, you can use width & height:

ion-spinner {
  width: 3em;
  height: 3em;
}

> https://github.com/ionic-team/ionic-framework/issues/18115

答案3

得分: 2

我遇到了一个类似的样式问题,为了解决它,我需要在CSS规则中添加position: absolute

英文:

I ran into a similar styling issue and to resolve it I needed to add
position: absolute to css rules

huangapple
  • 本文由 发表于 2020年1月3日 19:54:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/59578170.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定