css - Ionic 4,如何降低ionic-segment-button的高度
问题描述
我有以下可滚动段的代码:
<ion-segment mode="md" scrollable >
<ion-segment-button mode="md" *ngFor="let category of categories" value={{category}} (click)="FilterCateg(category)" >
{{ category }}
</ion-segment-button>
</ion-segment>
我怎样才能改变height
. ion-segment/ ion-segment-button
目前默认为50px
. 我试过设置height
但CSS
没有效果。找到SASS variables $segment-button-md-height and $segment-button-md-line-height
但找不到它们的等价物Ionic 4
解决方案
页面.scss
ion-segment-button
- 正在min-height 50px
接受md mode
default
你height
只在你的按钮中给出然后只有2px
高度减少因为min-height
是50px
默认的,
并且您min-height
仅在按钮中使用,然后高度没有变化
所以使用height
和min-height
两者
下面给出的例子:
ion-segment-button{
min-height: 30px; //Depends on you
height: 30px; //Depends on you
}
推荐阅读
- angular - Angular 6 - 无法在验证器指令中注入 NgControl
- git - 如何将本地裸存储库移动到 GitHub
- oauth-2.0 - Google Oauth 识别 G-Suite 帐户
- json - Azure Policy 为单个标记名称添加标记值
- r - 如何从 read.csv 生成的数据框而不是列表中获取单个值?
- c# - 使用 URL 以 JSON 格式导出 SSRS 报告
- ruby - 获取以 username:password@ 为前缀的 url
- javascript - WP wp_ajax_function 没有调用 PHP 函数
- laravel - 使用 Laravel 的学习管理系统的雄辩关系
- c# - 在“尝试显式指定类型参数”中比较哈希比较结果的结果