用xml创建带圆角和阴影的按钮背景
2014-08-17 17:55
162 查看
效果如图
按钮布局文件
背景drawable文件
按钮布局文件
<Button android:layout_width="match_parent" android:layout_height="80dip" android:background="@drawable/hi" android:text="@string/click_button" android:textColor="#999" android:textSize="18dip" android:textStyle="bold" />
背景drawable文件
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <!-- Bottom 2dp Shadow --> <item android:bottom="11px" android:top="19px" android:left="10px" android:right="10px"> <shape android:shape="rectangle" > <solid android:color="#ccc" /> <corners android:radius="7dp" /> </shape> </item> <!-- White Top color --> <item android:bottom="15px" android:top="15px" android:left="10px" android:right="10px"> <shape android:shape="rectangle" > <solid android:color="#FFFFFF" /> <corners android:radius="7dp" /> </shape> </item> </layer-list>
相关文章推荐
- IOS 创建圆角矩形按钮及设置阴影等其他属性
- moo弹出框 改进版 css外置 背景用图片 大小任意缩放 圆角 插入任意内容 自定义按钮 回车空格esc支持 滚动支持 动画开关
- 创建一个圆角矩形按钮
- Android 使用XML实现按钮改变焦点设置背景图
- iOS中创建自定义的圆角按钮
- 1,点击按钮后创建一个100px,背景银灰色的div,内容是HTML DOM练习
- CSS3下不一样的阴影、背景和圆角边框样式
- xml设置渐变+阴影的背景
- 关于如何去掉submit按钮背景阴影的解决方法
- xml 编写 android 圆角背景
- 蛙蛙推荐:css背景图片固定居中,div阴影,背景半透明,div圆角,DIV渐变
- 用XML实现按钮改变焦点设置背景图
- Android使用XML的方式为背景添加渐变,描边,圆角的效果
- 如何用控件的CALayer 的特性创建 圆角界面,边框,和设置背景
- css圆角背景图片按钮-自适应内容大小
- iOS中创建自定义的圆角按钮
- Android使用XML的方式为背景添加渐变,描边,圆角的效果
- Android XML中实现按钮点击效果以及背景平铺
- 使用 XML 实现按钮改变焦点设置背景图
- 原创超酷圆角带阴影焦点变色,还带提示按钮文本输入框