Bootstrap Button 使用方法

Getting Started

<!-- basic button -->
<com.beardedhen.androidbootstrap.BootstrapButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="10dp"
    android:text="Success"
    bootstrapbutton:bb_icon_right="fa-android"
    bootstrapbutton:bb_type="success"
/>

The above code inserts a default button with a android icon to the right. The following attributes can be added to any BootstrapButton

bootstrapbutton:bb_type="default" The type of button as per the Bootstrap CSS Buttons

bootstrapbutton:bb_icon_left="fa-heart" the icon to the left of the text, as per the Font Awesome Cheat Sheet

bootstrapbutton:bb_icon_right="fa-trophy" the icon to the right of the text, as per the Font Awesome Cheat Sheet

bootstrapbutton:bb_roundedCorners="true" whether the button should have rounded corners, the defaults is false

android:enabled="false" disabled buttons appear more opaque, the default is true (buttons are enabled)

bootstrapbutton:bb_size="large" Size of the button e.g. large, default, small, xsmall

android:textSize="12sp" Text size must always be in sp!

The button height (padding between text and button top/bottom) is not editable appart by using bb_size which also impact the text size. See this question for a workaround.

You can also edit the button programmatically!

button.setText("title"); changes the text displayed

button.setLeftIcon("fa-star"); changes the left icon

button.setRightIcon("fa-heart"); changes the right icon

button.setBootstrapType("success"); changes the type of bootstrap button

button.setBootstrapButtonEnabled("false"); change whether the button is enabled or disabled!

Bootstrap Button 使用方法

时间: 2024-08-28 15:23:06

Bootstrap Button 使用方法的相关文章

让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法转

让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法 最近做一个Web网站,之前一直觉得bootstrap非常好,这次使用了bootstrap3,在chrome,firefox,safari,opera,360浏览器(极速模式).搜狗浏览器等浏览器下均没有问题,而在IE8及IE11下发现样式无法显示,然后各种百度啊,最后在 雅朋网 的一个网友帖子的帮助下解决了问题,也参考了 千寻学习网 的资料,先将解决方法总结如下: 首先需要确保你的HTML页面开始部分要有DOC

转载------让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法

本文是转载及收藏 让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法 最近做一个Web网站,之前一直觉得bootstrap非常好,这次使用了bootstrap3,在chrome,firefox,safari,opera,360浏览器(极速模式).搜狗浏览器等浏览器下均没有问题,而在IE8及IE11下发现样式无法显示,然后各种百度啊,最后在 雅朋网 的一个网友帖子的帮助下解决了问题,也参考了 千寻学习网 的资料,先将解决方法总结如下: 首先需要确保你的HTML页面

UI 指派初始化方法 视图控制器 button响应方法

1 #import "MainViewController.h" 2 3 @interface MainViewController () 4 // 延展 :管理类私有的属性和方法 5 @end 6 7 @implementation MainViewController 8 // 指派初始化方法 9 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 10 { 11 self

Bootstrap Edit 使用方法

Getting Started <!-- rounded edit text --> <com.beardedhen.androidbootstrap.BootstrapEditText android:id="@+id/txtOne" android:layout_width="150dp" android:layout_height="wrap_content" android:layout_margin="10d

让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法

如有雷同,不胜荣幸,若转载,请注明 最近做一个Web网站,之前一直觉得bootstrap非常好,这次使用了bootstrap3,在chrome,firefox,safari,opera,360浏览器(极速模式).搜狗浏览器等浏览器下均没有问题,而在IE8及IE11下发现样式无法显示,然后各种百度啊,最后在 雅朋网 的一个网友帖子的帮助下解决了问题,也参考了 千寻学习网 的资料,先将解决方法总结如下: 首先需要确保你的HTML页面开始部分要有DOCTYPE声明.DOCTYPE告诉浏览器使用什么样的

免费获取Bootstrap模板的方法

Bootstrap是Twitter推出的一个开源的用于前端开发的工具包,其中中包含了丰富的Web组件,根据这些组件,可以快速的搭建一个漂亮.功能完备的网站. 最近通过了Bootstrap中文网学习了其中的一些的用法,深深被他简易用法,逻辑清晰,优雅界面所吸引.但是通过教程只能简单地理解其中的基本用法,但对于构建一些商业级的应用还是有一定距离.尤其对于我们这些开发人员来说,我们可能更需要的是获得更多的完整案例来作为参考,构建自己的所需要的模板. 网上有很多基于很多Bootstrap的模板与主题,但

让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法 --转载

最近做一个Web网站,之前一直觉得bootstrap非常好,这次使用了bootstrap3,在chrome,firefox,safari,opera,360浏览器(极速模式).搜狗浏览器等浏览器下均没有问题,而在IE8及IE11下发现样式无法显示,然后各种百度啊,最后在 雅朋网 的一个网友帖子的帮助下解决了问题,也参考了 千寻学习网 的资料,先将解决方法总结如下: 首先需要确保你的HTML页面开始部分要有DOCTYPE声明.DOCTYPE告诉浏览器使用什么样的HTML或XHTML规范来解析HTM

target-action设计模式--主要为Button的方法重写

新建两个类MainViewController/ButtonView ButtonView.h #import <UIKit/UIKit.h> @interface ButtonView : UIView //实现target-action设计模式 //点击的时候让谁去执行方法 @property (nonatomic , assign) id target; //要执行的方法 @property (nonatomic , assign) SEL action; //模拟一个UIButton的

MFC中Radio Button使用方法

先为对话框加上2个radio button,分别是Radio1和Radio2. 问题1:如何让Radio1或者Radio2默认选上?如何知道哪个被选上了? 关键是选上,“默认”只要放在OnInitDialog()即可.三种方法可以让它选上,第一种:((CButton *)GetDlgItem(IDC_RADIO1))->SetCheck(TRUE);//选上((CButton *)GetDlgItem(IDC_RADIO1))->SetCheck(FALSE);//不选上((CButton *