项目中用到的圆形按钮,做个半天,用sharp形式实现,样式代码如下:

<Button
android:id="@+id/btn_5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/general_consulting"
android:textColor="@color/white"
android:textSize="@dimen/text_size18"
android:background="@drawable/bg_special_disease_circle"/>

其他不用在意,background bg_special_disease_circle.xml 样式代码如下:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item>
<shape android:shape="oval" >
<corners android:radius="@dimen/size90"/>
<solid android:color="@color/white" />
<size android:width="170dp" android:height="170dp"/>
</shape>
</item> <item android:bottom="8dp" android:right="8dp" android:top="8dp" android:left="8dp" >
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="oval" >
<corners android:radius="@dimen/size90"/>
<solid android:color="#e66b4f" />
<size android:width="162dp" android:height="162dp"/>
</shape>
</item> <item>
<shape android:shape="oval" >
<corners android:radius="@dimen/size90"/>
<solid android:color="#f3876f" />
<size android:width="162dp" android:height="162dp"/>
</shape>
</item> </selector>
</item> </layer-list>

Android 圆形按钮实现的更多相关文章

  1. android 圆形按钮

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools=&q ...

  2. Android高手速成--第一部分 个性化控件(View)

    第一部分 个性化控件(View) 主要介绍那些不错个性化的View,包括ListView.ActionBar.Menu.ViewPager.Gallery.GridView.ImageView.Pro ...

  3. 据说年薪30万的Android程序员必须知道的帖子

    Android中国开发精英 目前包括: Android开源项目第一篇--个性化控件(View)篇       包括ListView.ActionBar.Menu.ViewPager.Gallery.G ...

  4. Android开源项目分类汇总

    目前包括: Android开源项目第一篇——个性化控件(View)篇   包括ListView.ActionBar.Menu.ViewPager.Gallery.GridView.ImageView. ...

  5. android 很多牛叉布局github地址(转)

    原文地址 http://blog.csdn.net/luo15309823081/article/details/41449929 点击可到达github-------https://github.c ...

  6. GitHub上史上最全的Android开源项目分类汇总 (转)

    GitHub上史上最全的Android开源项目分类汇总 标签: github android 开源 | 发表时间:2014-11-23 23:00 | 作者:u013149325 分享到: 出处:ht ...

  7. !! 据说年薪30万的Android程序员必须知道事

    http://www.th7.cn/Program/Android/201512/742423.shtml Android中国开发精英 目前包括: Android开源项目第一篇——个性化控件(View ...

  8. 【Android】Android开源项目分类汇总

    第一部分 个性化控件(View) 主要介绍那些不错个性化的View,包括ListView.ActionBar.Menu.ViewPager.Gallery.GridView.ImageView.Pro ...

  9. Android开源项目汇总【转】

    主要介绍那些不错个性化的View,包括ListView.ActionBar.Menu.ViewPager.Gallery.GridView.ImageView.ProgressBar.TextView ...

随机推荐

  1. Poj3484-Showstopper(二分脑洞题)

    Description Data-mining huge data sets can be a painful and long lasting process if we are not aware ...

  2. 再造轮子之网易彩票-第一季(IOS 篇 by sixleaves)

    前言 在网上看了别人做的模仿网易彩票的项目, 于是也跟着用自己的想法做了一篇.写这篇博客的目的, 在于UI综合的一次小练习, 同时总结和串联其各个控件之间的应用.封装思想等.考虑到有人上不了githu ...

  3. java匿名内部类,多态,接口练习

    1多态以及接口调用方法: public class Interface { public static void main(String[] args) { Al x = new Al(); jian ...

  4. Qwerty78 Trip(组合数,规律,逆元)

    Qwerty78 Trip time limit per test 2 seconds memory limit per test 64 megabytes input standard input ...

  5. VC调试笔记

    1.windows-32调试: ①使用map文件根据崩溃地址寻找对应的源代码文件和行号 勾选project->settings->link->General mapfile,对应的P ...

  6. Dalvik虚拟机简要介绍和学习计划

    文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/8852432 我们知道,Android应用程序是 ...

  7. jquery selector

    jquery的选择器功能 1 :lt(index) selector 一组元素选择index之前的元素,若index<0 则倒着选过来 http://api.jquery.com/lt-sele ...

  8. json返回数据拼接HTML

    <div class="box-lists">  </div> $.ajax({ url: 'AjaxPage/AjaxHandler.ashx', typ ...

  9. Java坑一

    public class Test { public static void main(String[] args) { Integer a = 12; Integer b = 12; System. ...

  10. java web移植 遇到Project facet Java version 1.7 is not supported

    在移植eclipse项目时,如果遇到 "Project facet Java version 1.7 is not supported." 项目中的jdk1.7不支持.说明项目是其 ...