码迷,mamicode.com
首页 > 其他好文 > 详细

Bootstrap Button 使用方法

时间:2014-07-31 16:34:56      阅读:303      评论:0      收藏:0      [点我收藏+]

标签:android   http   使用   io   for   art   ar   div   

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 使用方法,布布扣,bubuko.com

Bootstrap Button 使用方法

标签:android   http   使用   io   for   art   ar   div   

原文地址:http://www.cnblogs.com/boundary/p/3880756.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!