Segmented Button 的应用

Segmented Button 常被用作工具条、导航栏,默认为单选切换,如果想实现多选,只需设置allowMultiple属性为true。

JS:

{
    xtype: ‘container‘,
    items: [{
            xtype: ‘segmentedbutton‘,
            allowMultiple: true,
            layout: ‘hbox‘,
            cls: ‘segBtns‘,
            defaults: {
                ui: ‘plain‘,
                cls: ‘btn‘
            },
            items: [{
                    text: ‘爱情‘,
                    flex: 1,
                    pressed: true
                },
                {
                    text: ‘事业‘,
                    flex: 1
                },
                {
                    text: ‘梦想‘,
                    flex: 1
                },
            ],
            listeners: {
                element: ‘element‘,
                toggle: {
                    fn: function(container, button, pressed) {
                        alert();
                    }
                }
            }
        }

    ],
}

CSS:

.segBtns .btn{
    color: white;
    border-radius: 0px;
    background: #0E4A75;
}
.segBtns .btn.x-button-pressed{
    background: yellow;
    color: red;
}

2.在app.json,bootstrap.json中引入自定义css。

时间: 2024-08-01 10:46:04

Segmented Button 的应用的相关文章

Bootstrap v4.0.0-alpha.4 发布

Bootstrap v4.0.0-alpha.4 发布了,这个版本主要的变化是用一个小的"alpha patch" 来命名一个没有任何JS文件的npm包,并且对我们的 CSS 和 docs 进行了一些小小的改变. CSS #20130: Make .bg-inverse use the background variant mixin for proper text color. #20333: Update progress bar to use $progress-border-r

android:style.xml

1 <?xml version="1.0" encoding="utf-8"?> 2 <!-- Copyright (C) 2006 The Android Open Source Project 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance wi

从零开始学ios开发(六):IOS控件(3),Segmented Control、Switch

这次的学习还是基于上一个项目继续进行(你也可以新建一个项目)学习Segmented Control和Switch. Segmented Control Switch Segmented Control和Switch的主要区别在于Segmented Control可以有多个值进行选择,而Switch只有2个值. 1)添加Segmented Control从object library中拖一个Segmented Control到iphone界面上然后调整Segmented Control位置以及它的

IOS学习之segmented control

转载请注明出处 http://blog.csdn.net/pony_maggie/article/details/27086877 作者:小马 什么是segmented control? 先上几张图:                     这几幅图就是典型的segmented control UI视图, 第一幅是某个游戏程序,红色框出来的就是segmentedcontrol. 后面三幅是我这篇博文做的demo演示样例. segmented control有例如以下几个特征: 1一般是在单视图中

【转】Android - Button(按钮)的响应点击事件的4种写法

原文网址:http://www.yrom.net/blog/2011/12/12/android-4-onclicklistener-of-button/ Button控件setOnclickListener(View.OnClickListener listener)来接收一个点击事件的监听器 自定义一个点击事件监听器类让其实现View.OnClickListener的onClick(View v)方法 1 2 3 4 5 class MyOnClickListener implements

对另一个布局文件里的Button按钮进行监听

布局文件里面的Button写上 onClick = “onClick”,然后在你当前Activity的onClick方法中根据Button的id来做相应的操作 android:id="@+id/single_file_download" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" androi

安卓给button增加点击事件

@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.mmmm); //获取XML里面的button Button button=(Button)findViewById(R.id.button1); //给button增加点击事件 button.setOnClickListener(new OnClick

AFNetworking imageView button设置图片缓存

如果对AFNetworking 下载的图片不进行缓存,可能会导致每次加载  image图片的时候都会重新 下载图片; 严重浪费资源: AFNetworking有自带的很方便的配置缓存图片的方法: 在 UIKit+AFNetworking中, imageView和Button的类目都可以设置缓存: 方法如下: button [UIButton setSharedImageCache:[UIButton sharedImageCache]]; imageView [UIImageView setSh

IOS 自定义UIBUTTON 直接拖个xib 就能在button上显示多行文本 并且添加了点击的效果

拖个button继承一下  几行代码 就搞定 自用效果还行 IOS 自定义UIBUTTON 直接拖个xib 就能在button上显示多行文本 并且添加了点击的效果,布布扣,bubuko.com