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布局文件實現(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://chabaoo.cn/css/23418.html
- Android編程之Button控件配合Toast控件用法分析
- Android定制RadioButton樣式三種實現(xiàn)方法
- Android點擊Button實現(xiàn)功能的幾種方法總結(jié)
- Android 控件(button)對齊方法實現(xiàn)詳解
- Android實現(xiàn)點擊Button產(chǎn)生水波紋效果
- Android中的Button自定義點擊效果實例代碼
- android之自定義Toast使用方法
- android自定義toast(widget開發(fā))示例
- android開發(fā)教程之實現(xiàn)toast工具類
- Android編程基礎(chǔ)之簡單Button事件響應(yīng)綜合提示控件Toast應(yīng)用示例
相關(guān)文章
Android Studio使用ButterKnife和Zelezny的方法
這篇文章主要為大家詳細介紹了Android Studio使用ButterKnife和Zelezny的方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下2018-04-04Android SQLite3多線程操作問題研究總結(jié)
這篇文章主要介紹了Android SQLite3多線程操作問題研究總結(jié),本文總結(jié)了SQLite3是否支持多線程、SQLiteDatabase的同步鎖、多線程讀數(shù)據(jù)庫等問題,需要的朋友可以參考下2015-03-03在Flutter中制作翻轉(zhuǎn)卡片動畫的完整實例代碼
最近Flutter的勢頭是越來越猛了,作為一個Android程序猿,我自然也是想要趕緊嘗試一把,這篇文章主要給大家介紹了關(guān)于在Flutter中制作翻轉(zhuǎn)卡片動畫的相關(guān)資料,需要的朋友可以參考下2021-10-10Android程序開發(fā)之動態(tài)設(shè)置ImageView的亮度
這篇文章主要介紹了Android程序開發(fā)之動態(tài)設(shè)置ImageView的亮度 的相關(guān)資料,需要的朋友可以參考下2016-01-01Android實戰(zhàn)教程第六篇之一鍵鎖屏應(yīng)用問題解決
這篇文章主要為大家詳細介紹了Android一鍵鎖屏應(yīng)用開發(fā)過程中出現(xiàn)問題的解決方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下2016-11-11