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)的,一張圖片都未曾使用。
順便貼出幾個(gè)布局文件給大家看看:
<?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>
這里有個(gè)工程,開源的
http://code.google.com/p/android-gradients-sample/downloads/list
順便把這兩個(gè)網(wǎng)頁給收了,說不定以后能夠提供靈感或者參考
http://www.webdesignshock.com/css-button
http://www.dbjr.com.cn/css/23418.html
- Android編程之Button控件配合Toast控件用法分析
- Android定制RadioButton樣式三種實(shí)現(xiàn)方法
- Android點(diǎn)擊Button實(shí)現(xiàn)功能的幾種方法總結(jié)
- Android 控件(button)對(duì)齊方法實(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)文章
利用Fiddler對(duì)手機(jī)進(jìn)行抓包的實(shí)現(xiàn)方法
下面小編就為大家?guī)硪黄肍iddler對(duì)手機(jī)進(jìn)行抓包的實(shí)現(xiàn)方法。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-05-05Android Studio使用ButterKnife和Zelezny的方法
這篇文章主要為大家詳細(xì)介紹了Android Studio使用ButterKnife和Zelezny的方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2018-04-04Android SQLite3多線程操作問題研究總結(jié)
這篇文章主要介紹了Android SQLite3多線程操作問題研究總結(jié),本文總結(jié)了SQLite3是否支持多線程、SQLiteDatabase的同步鎖、多線程讀數(shù)據(jù)庫等問題,需要的朋友可以參考下2015-03-03在Flutter中制作翻轉(zhuǎn)卡片動(dòng)畫的完整實(shí)例代碼
最近Flutter的勢(shì)頭是越來越猛了,作為一個(gè)Android程序猿,我自然也是想要趕緊嘗試一把,這篇文章主要給大家介紹了關(guān)于在Flutter中制作翻轉(zhuǎn)卡片動(dòng)畫的相關(guān)資料,需要的朋友可以參考下2021-10-10Android程序開發(fā)之動(dòng)態(tài)設(shè)置ImageView的亮度
這篇文章主要介紹了Android程序開發(fā)之動(dòng)態(tài)設(shè)置ImageView的亮度 的相關(guān)資料,需要的朋友可以參考下2016-01-01Android實(shí)戰(zhàn)教程第六篇之一鍵鎖屏應(yīng)用問題解決
這篇文章主要為大家詳細(xì)介紹了Android一鍵鎖屏應(yīng)用開發(fā)過程中出現(xiàn)問題的解決方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-11-11Android的OkHttp包處理用戶認(rèn)證的代碼實(shí)例分享
OkHttp包(GitHub主頁github.com/square/okhttp)是一款高人氣安卓HTTP支持包,這里我們來看一下Android的OkHttp包處理用戶認(rèn)證的代碼實(shí)例分享:2016-07-07