项目中用到的圆形按钮,做个半天,用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. MVC 自定义错误处理

    1. Application_Error namespace Libaray.Web{ public class MvcApplication : System.Web.HttpApplication ...

  2. 安装ArchLinux的参考分区方案

    其实就是从Archwiki上搬运过来的 = =. 分区方案 虽然有一些关于分区方案的通用建议,但没有严格的准则.有许多影响分区方案的因素,例如对灵活性的期望,访问速度,安全性以及可用磁盘空间的硬性限制 ...

  3. 【BBST 之伸展树 (Splay Tree)】

    最近“hiho一下”出了平衡树专题,这周的Splay一直出现RE,应该删除操作指针没处理好,还没找出原因. 不过其他操作运行正常,尝试用它写了一道之前用set做的平衡树的题http://codefor ...

  4. 团队介绍 | 魅动 Magic Motion

    团队介绍 | 魅动 Magic Motion 魅动 Magic Motion 是专注于研发.设计和生产智能化私密生活用品的创新品牌.魅动 Magic Motion 将无线移动通信技术与私密生活产品相结 ...

  5. Android面试题07

    62. 说说mvc模式的原理,它在android中的运用. MVC英文即Model-View-Controller,即把一个应用的输入.处理.输出流程按照Model.View.Controller的方 ...

  6. AC Milan VS Juventus(模拟)

    AC Milan VS Juventus Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Oth ...

  7. sql注入数据库修复方法

    1.第一种情况是 需要将指定的 注入字符串全部替换掉(仅替换注入的字符串为空) declare @delStr nvarchar(500) set @delStr='<script src=ht ...

  8. Android系统进程间通信(IPC)机制Binder中的Server启动过程源代码分析

    文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/6629298 在前面一篇文章浅谈Android系 ...

  9. html5的a标签使用

    主要是href和target两个属性 示比例如以下: <a href="" target="_blank">Visit w3school</a ...

  10. BOOST::Signals2

    /* Andy is going to hold a concert while the time is not decided. Eric is a fans of Andy who doesn't ...