ionic2中ion-segment用法
来源:互联网 发布:房地产网络端口是什么 编辑:程序博客网 时间:2024/05/16 08:35
segment是一组按钮,有时称为分段控件,允许用户与许多控件的紧凑组进行交互。 分段提供与标签相似的功能,选择一个将取消选择所有其他选项。 当您希望让用户在应用程序的不同页面之间来回移动时,应使用选项卡栏而不是分段控件。 您可以使用Angular的ngModel或FormBuilder API。
效果看图看代码:
<!-- Segment 在头部使用 --><ion-header> <ion-toolbar> <ion-segment [(ngModel)]="icons" color="secondary"> <ion-segment-button value="camera"> <ion-icon name="camera">带iocn</ion-icon> </ion-segment-button> <ion-segment-button value="bookmark"> 头部使用Segment <ion-icon name="bookmark"></ion-icon> </ion-segment-button> </ion-segment> </ion-toolbar></ion-header><!-- Segment 在内容里面使用 --><ion-segment [(ngModel)]="relationship" color="primary" (ionChange)="segmentChanged($event)"> <ion-segment-button value="friends"> Segment 在内容里面使用 </ion-segment-button> <ion-segment-button value="enemies"> 可以绑定一个事件(ionChange) </ion-segment-button></ion-segment><!-- Segment 在表单里面使用 --><form [formGroup]="myForm"> <ion-segment formControlName="mapStyle" color="danger"> <ion-segment-button value="standard"> Standard </ion-segment-button> <ion-segment-button value="hybrid"> 表单内使用 </ion-segment-button> <ion-segment-button value="sat"> Satellite </ion-segment-button> </ion-segment></form><!-- Segment 配合ngSwitch使用 --><ion-segment [(ngModel)]="change"> <ion-segment-button value="apple"> 苹果 </ion-segment-button> <ion-segment-button value="pie"> 梨 </ion-segment-button></ion-segment><div [ngSwitch]="change"> <div *ngSwitchCase="'apple'"> 苹果显示,如果要默认显示一个就把默认的那个设置一个初始值比如要默认显示苹果就把苹果的value值设置成change </div> <div *ngSwitchCase="'pie'"> 梨显示 </div></div>效果:
参照文档:https://ionicframework.com/docs/api/components/segment/Segment/
样式
Sass變量
iOS 材料設計 Windows平台
$segment-button-ios-background-color
transparent
分段按鈕的背景
$segment-button-ios-background-color-activated
$toolbar-ios-active-color
激活的段按鈕的背景
$segment-button-ios-text-color
color-contrast($colors-ios, $segment-button-ios-background-color-activated)
段按鈕的文本顏色
$segment-button-ios-transition-activated
100ms all linear
激活的段按鈕的轉換
$segment-button-ios-transition-hover
100ms all linear
盤旋按鈕的切換
$segment-button-ios-transition-active
100ms all linear
按按鈕切換分段按鈕
$segment-button-ios-opacity-hover
.1
懸停的細分按鈕的不透明度
$segment-button-ios-opacity-active
.16
按下分段按鈕的不透明度
$segment-button-ios-opacity-activated
1
激活的段按鈕的不透明度
$segment-button-ios-opacity-disabled
.3
禁用段的不透明度按鈕
$segment-button-ios-border-width
1px
段按鈕的邊框寬度
$segment-button-ios-height
3.2rem
段按鈕的高度
$segment-button-ios-line-height
3rem
分段按鈕的線高度
$segment-button-ios-font-size
1.3rem
段按鈕的字體大小
$segment-button-ios-border-radius
4px
分段按鈕的邊框半徑
$segment-button-ios-icon-size
2.6rem
細分按鈕中圖標的大小
$segment-button-ios-icon-line-height
2.8rem
段按鈕中圖標的線高度
$segment-button-ios-toolbar-button-max-width
100px
工具欄中段按鈕的最大寬度
$segment-button-ios-toolbar-button-height
2.6rem
工具欄中的段按鈕的高度
$segment-button-ios-toolbar-line-height
2.5rem
工具欄中的段按鈕的線高度
$segment-button-ios-toolbar-font-size
1.2rem
工具欄中的段按鈕的字體大小
$segment-button-ios-toolbar-icon-size
2.2rem
工具欄中“段”按鈕中圖標的大小
$segment-button-ios-toolbar-icon-line-height
2.4rem
工具欄中的段按鈕中圖標的線高度
阅读全文
0 0
- ionic2中ion-segment用法
- 关于ionic2 中 segment 默认选中
- ionic2中ion-slides轮播图报错Uncaught TypeError: Cannot read property 'hasAttribute' of undefined
- ionic2 ion-select 设置默认选项
- ionic中ion-multi-picker报错Cannot find module 'ion-multi-picker'.以及ion-multi-picker用法
- ion-item用法收集
- Ionic2 可以左右滑动的Segment
- ION-中传
- Ionic2中使用ECharts3
- ionic2中实现 IndexedDB
- ion
- ion
- ION
- ionic2中 NavController导航组件用法方法关于页面的导航
- 【Ionic】 <ion-navbar>标签的用法;
- ion-content中存在ion-list,在ion-list外固定其他控件位置不滚动
- ionic2
- Ionic2 中调用 js 代码
- Java设计模式之六大原则
- MySQL--操作简记(联结表,组合查询(UNION))
- STL 容器
- C#1的核心基础之值类型和引用类型
- 改进型归一化混音算法
- ionic2中ion-segment用法
- Hibernate中主键增长的方式? assigned sequence identity increment 都代表什么意思
- Android 创建数据库 SQliteDatabase
- (拓扑排序)确定比赛名次--HDOJ
- java.lang.IllegalStateException
- 怎么清理苹果电脑垃圾 CleanMymac 4 免激活 破解版下载
- Bootstrap : 栅格对应的屏幕尺寸
- 新特性总结-JDK1.3
- 数据库mysql的笔记