Android 圆形按钮实现
项目中用到的圆形按钮,做个半天,用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 圆形按钮实现的更多相关文章
- android 圆形按钮
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools=&q ...
- Android高手速成--第一部分 个性化控件(View)
第一部分 个性化控件(View) 主要介绍那些不错个性化的View,包括ListView.ActionBar.Menu.ViewPager.Gallery.GridView.ImageView.Pro ...
- 据说年薪30万的Android程序员必须知道的帖子
Android中国开发精英 目前包括: Android开源项目第一篇--个性化控件(View)篇 包括ListView.ActionBar.Menu.ViewPager.Gallery.G ...
- Android开源项目分类汇总
目前包括: Android开源项目第一篇——个性化控件(View)篇 包括ListView.ActionBar.Menu.ViewPager.Gallery.GridView.ImageView. ...
- android 很多牛叉布局github地址(转)
原文地址 http://blog.csdn.net/luo15309823081/article/details/41449929 点击可到达github-------https://github.c ...
- GitHub上史上最全的Android开源项目分类汇总 (转)
GitHub上史上最全的Android开源项目分类汇总 标签: github android 开源 | 发表时间:2014-11-23 23:00 | 作者:u013149325 分享到: 出处:ht ...
- !! 据说年薪30万的Android程序员必须知道事
http://www.th7.cn/Program/Android/201512/742423.shtml Android中国开发精英 目前包括: Android开源项目第一篇——个性化控件(View ...
- 【Android】Android开源项目分类汇总
第一部分 个性化控件(View) 主要介绍那些不错个性化的View,包括ListView.ActionBar.Menu.ViewPager.Gallery.GridView.ImageView.Pro ...
- Android开源项目汇总【转】
主要介绍那些不错个性化的View,包括ListView.ActionBar.Menu.ViewPager.Gallery.GridView.ImageView.ProgressBar.TextView ...
随机推荐
- WPF用样式实现TextBox的虚拟提示效果
[版权声明]本文为博主原创,未经允许禁止用作商业用途,如有转载请注明出处. 话说好多软件和网站都能实现虚拟提示,好吧这个名词是我自己起的,因为我也不知道这么形容这个效果. 效果描述:在TextBox没 ...
- Php基本语法数据类型操作基础训练
<?php /* * Created on 2015年12月17日 * * To change the template for this generated file go to * Wind ...
- TCP快速重传和快速恢复
当tcp传送一个分组时会设置一个定时器,如果在规定的实际间隔内没有收到ACK分组,那么则重新传输该分组,但是 如果tcp收到三个连续的ACK分组,此时不管是否过超时间隔则重传该分组,具体步骤如下: 1 ...
- OpensStack instance debug
错误: 创建实例 "RuiyTest23" 失败: 请稍后再试 [错误: Virtual Interface creation failed].
- Python Open Flash Chart (pyOFC2) — Home
Python Open Flash Chart (pyOFC2) - Home pyOFC2 Python Open Flash Chart 2
- linux之getcwd函数解析
[lingyun@localhost getcwd]$ cat getcwd.c /********************************************************** ...
- Qt之模型/视图(委托)
# -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' from PyQt4.Qt import * from PyQt4. ...
- Uiviewcontroller 控制器的生命周期
这是一个ViewController完整的声明周期,其实里面还有好多地方需要我们注意一下: 1:initialize函数并不会每次创建对象都调用,只有在这个类第一次创建对象时才会调用,做一些类的准备工 ...
- Swift之贪婪的UIButton
一.内容概要 按钮是所有UI体系中非常重要的组件,在iOS中按钮UIButton的使用也非常灵活,本文将从以下几点介绍UIButton的使用(基于Swift2.0): 1.UIButton基础 2.U ...
- jsp当参数为空的时候默认显示值
当${business.branchName }为空或者不存在的时候显示“请选择门店” <c:out value="${business.branchName }" defa ...