首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ionic2圆段-按钮

Ionic2圆段-按钮
EN

Stack Overflow用户
提问于 2016-07-22 13:27:45
回答 1查看 5.6K关注 0票数 2

是否有人知道如何将段按钮的css从正方形更改为圆形?

我试过使用普通的css,但是当ionic2试图转换segment-activated上的按钮时,它会变得很糟糕--这里是一个柱塞示例

代码语言:javascript
复制
<ion-segment [(ngModel)]="date" danger>
  <ion-segment-button value="1">
    1
  </ion-segment-button>
  <ion-segment-button value="2">
    2
  </ion-segment-button>
  <ion-segment-button value="3">
    3
  </ion-segment-button>
</ion-segment>

对于普通css,我失败了。当你选择另一个按钮时会变得很奇怪

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-08-01 08:14:50

找到了一个黑客来做这个。NB这是一个黑客和风格不打算这一点。

Css解决方案:将其放在您的.scss文件中

代码语言:javascript
复制
ion-segment-button{
  //max-width: 25px;
  border-style: solid;
}

.segment-button {
  border-style: none;
  border-color: #e62100;
  color: #e62100;
  border-width: thin;
}

.segment-button:first-of-type {
  border-radius: 90px 90px 90px 90px;
  // margin-right: 0px;
  margin-left: 0px;
  line-height: 3.4rem;
  height: 100%;
  width: 100%}
.segment-button:not(:first-of-type) {
  border-radius: 90px 90px 90px 90px;
 // margin-right: 0px;
  margin-left: 20px;
  line-height: 3.4rem;
  height: 100%;
  width: 100%;}
.segment-button:last-of-type {
  border-radius: 90px 90px 90px 90px;
  margin-right: 0px;
  margin-left: 20px;
  line-height: 3.4rem;
  height: 100%;
  width: 100%;}


 .segment-activated{
  background-color: #e62100;
  color: #ffffff;
}
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38527700

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档