有没有办法使iOS和Android上的离子段看起来相同? [英] Is there a way to make ion-segment look the same on both iOS and Android?

查看:66
本文介绍了有没有办法使iOS和Android上的离子段看起来相同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设置离子段的模式后,在离子实验室中渲染它们后,它们看起来仍然有所不同.

After setting the mode of ion-segment, they still look different after rendering them in ionic lab.

我曾尝试将ion-segment和ion-toolbar的模式设置为"md",但它们看起来仍然不同.

I have tried setting the mode of ion-segment and ion-toolbar to "md" but they still look different.

https://ibb.co/HV75Ly2 这是设置了模式.

<ion-toolbar mode="md">
    <ion-segment scrollable mode="md">
      <ion-segment-button value="top" checked>
        TOP
      </ion-segment-button>
      <ion-segment-button value="nfl">
        NFL
      </ion-segment-button>
      <ion-segment-button value="nba">
        NBA
      </ion-segment-button>
      <ion-segment-button value="mlb">
        MLB
      </ion-segment-button>
      <ion-segment-button value="nhl">
        NHL
      </ion-segment-button>
      <ion-segment-button value="ncaaf">
        NCAAF
      </ion-segment-button>
      <ion-segment-button value="ncaab">
        NCAAB
      </ion-segment-button>
    </ion-segment>
</ion-toolbar>

我希望ion-segment在两个平台上都看起来像android版本,但是目前,它们看起来还是不一样.

I would like the ion-segment to look like the android version on both platforms but currently, they still look different.

推荐答案

由于Ionic 4 beta之一,您还必须在每个组件上设置mode.

Since one of the Ionic 4 beta's you also have to set mode on every component.

这也意味着ion-segment-button组件,例如:

This means the ion-segment-button components as well, like:

<ion-toolbar mode="md">
    <ion-segment scrollable mode="md">
      <ion-segment-button mode="md" value="top" checked>
        TOP
      </ion-segment-button>
      <ion-segment-button mode="md" value="nfl">
        NFL
      </ion-segment-button>
      <ion-segment-button mode="md" value="nba">
        NBA
      </ion-segment-button>
      <ion-segment-button mode="md" value="mlb">
        MLB
      </ion-segment-button>
      <ion-segment-button mode="md" value="nhl">
        NHL
      </ion-segment-button>
      <ion-segment-button mode="md" value="ncaaf">
        NCAAF
      </ion-segment-button>
      <ion-segment-button mode="md" value="ncaab">
        NCAAB
      </ion-segment-button>
    </ion-segment>
</ion-toolbar>

这篇关于有没有办法使iOS和Android上的离子段看起来相同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆