android椭圆线按钮,GitHub - tc310/ButtonStyle: 圆角,椭圆等按钮,不用再写shape文件。Rounded corners, oval buttons, no need...

ButtonStyle

圆角,椭圆等按钮,不用再写shape文件。Rounded corners, oval buttons, no need to write shape files

Step 1

Gradle

dependencies {

compile 'com.lai:buttonStyle:1.0.2'

}

Step 2

在布局上/In Layout

xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:app="http://schemas.android.com/apk/res-auto"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:orientation="vertical"

>

android:layout_width="match_parent"

android:layout_height="40dp"

android:layout_margin="5dp"

android:text="成功/Success"

app:type="ok"/>

android:id="@+id/activity_btn_1"

android:layout_width="match_parent"

android:layout_height="40dp"

android:text="@string/app_name"

app:normal_color="#F1F1F1"

app:press_color="#E9EEF2"

app:stroke_color="#CCCDD0"

app:stroke_width="1dp"/>

预览/preview

7bacf60af75b04ba0ec6d25fec34d819.png

XML 属性 /XML Attribute

属性/Attribute介绍/introducetype根据固定的值快速配置出按钮: ok,info,warning,error

normal_color默认颜色 /Default color

press_color按下颜色/Press color

stroke_color边框颜色 / stroke color

stroke_width边框宽度 / stroke width

corner圆角大小 / corner size

方法 Main Method

setPressedColor setNormalColor setCurrCorner  setStrokeWidth setStrokeColor

更新日志 Update Logs

v1.0.2

新增type属性。增加模板配置按钮

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值