Android自定義格式顯示Button的布局思路
先把來源貼上
http://zrgiu.com/blog/2011/01/making-your-android-app-look-better/
http://www.dibbus.com/2011/02/gradient-buttons-for-android/http://www.dibbus.com/2011/08/even-more-gradient-buttons-for-android/
然后再讓大家看看效果,這些都是xml布局文件實(shí)現(xiàn)的,一張圖片都未曾使用。



順便貼出幾個布局文件給大家看看:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" >
<shape>
<solid
android:color="#449def" />
<stroke
android:width="1dp"
android:color="#2f6699" />
<corners
android:radius="3dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
<item>
<shape>
<gradient
android:startColor="#449def"
android:endColor="#2f6699"
android:angle="270" />
<stroke
android:width="1dp"
android:color="#2f6699" />
<corners
android:radius="4dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
</selector>
<?xml version=”1.0″ encoding=”UTF-8″?>
<shape xmlns:android=”http://schemas.android.com/apk/res/android”>
<solid android:color=”#F000″/>
<stroke android:width=”1px” android:color=”#BB000000″ />
<padding
android:left=”10dp”
android:top=”7dp”
android:right=”10dp”
android:bottom=”7dp”
/>
<corners
android:bottomRightRadius=”5dp”
android:bottomLeftRadius=”5dp”
android:topLeftRadius=”5dp”
android:topRightRadius=”5dp”
/>
<gradient
android:angle=”90″
android:startColor=”#4747e0″
android:centerColor=”#5b5bcd”
android:endColor=”#6f6fcf”
android:type=”linear”
/>
</shape>
這里有個工程,開源的
http://code.google.com/p/android-gradients-sample/downloads/list
順便把這兩個網(wǎng)頁給收了,說不定以后能夠提供靈感或者參考
http://www.webdesignshock.com/css-button
http://m.fzitv.net/css/23418.html
- Android編程之Button控件配合Toast控件用法分析
- Android定制RadioButton樣式三種實(shí)現(xiàn)方法
- Android點(diǎn)擊Button實(shí)現(xiàn)功能的幾種方法總結(jié)
- Android 控件(button)對齊方法實(shí)現(xiàn)詳解
- Android實(shí)現(xiàn)點(diǎn)擊Button產(chǎn)生水波紋效果
- Android中的Button自定義點(diǎn)擊效果實(shí)例代碼
- android之自定義Toast使用方法
- android自定義toast(widget開發(fā))示例
- android開發(fā)教程之實(shí)現(xiàn)toast工具類
- Android編程基礎(chǔ)之簡單Button事件響應(yīng)綜合提示控件Toast應(yīng)用示例
相關(guān)文章
基于App自適應(yīng)draw9patch不失真背景的方法詳解
本篇文章是對App自適應(yīng)draw9patch不失真背景的方法進(jìn)行了詳細(xì)的分析介紹。需要的朋友參考下2013-05-05
詳解關(guān)于MIUI 9沉浸式狀態(tài)欄的最新適配
由于各系統(tǒng)版本的限制,沉浸式狀態(tài)欄對系統(tǒng)有要求,本篇文章主要介紹了詳解關(guān)于MIUI 9沉浸式狀態(tài)欄的最新適配,非常具有實(shí)用價值,需要的朋友可以參考下2018-05-05
Android Camera實(shí)現(xiàn)毫秒級拍照實(shí)例
本篇文章主要介紹了Android Camera實(shí)現(xiàn)毫秒級拍照實(shí)例,具有一定的參考價值,感興趣的小伙伴們可以參考一下。2017-06-06
Android編程實(shí)現(xiàn)畫板功能的方法總結(jié)【附源碼下載】
這篇文章主要介紹了Android編程實(shí)現(xiàn)畫板功能的方法,結(jié)合實(shí)例形式總結(jié)分析了Android基于自定義View與Canvas類實(shí)現(xiàn)畫板功能的具體操作步驟與相關(guān)注意事項(xiàng),需要的朋友可以參考下2018-02-02
Android?Springboot?實(shí)現(xiàn)SSE通信案例詳解
SSE是一種用于實(shí)現(xiàn)服務(wù)器主動向客戶端推送數(shù)據(jù)的技術(shù),它基于?HTTP?協(xié)議,利用了其長連接特性,在客戶端與服務(wù)器之間建立一條持久化連接,并通過這條連接實(shí)現(xiàn)服務(wù)器向客戶端的實(shí)時數(shù)據(jù)推送,這篇文章主要介紹了Android?Springboot?實(shí)現(xiàn)SSE通信案例,需要的朋友可以參考下2024-07-07

