第三章,设置按钮边框(Android)
来源:互联网 发布:可口可乐表白软件 编辑:程序博客网 时间:2024/05/01 04:27
这种方法是通过层叠几个图片实现边框效果。
在res文件夹下的drawable文件夹下(没有就新建)建一个xml文件选layer-list。
<?xml version="1.0" encoding="UTF-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <!-- 与顺序有关,最外层一定要放在最前面,最里层放在里面, 不然会被遮挡,也与item中设置的值大小有关系--> <!-- 最外层 --> <item> <shape> <solid android:color="#1e90ff" /> </shape> </item> <!-- 中间层 --> <item android:bottom="15dp" android:left="15dp" android:right="15dp" android:top="15dp"> <shape> <solid android:color="#ffffff" /> </shape> </item> <!-- 最里层 --> <item android:bottom="30dp" android:left="30dp" android:right="30dp" android:top="30dp"> <shape> <solid android:color="#bebebe" /> </shape> </item></layer-list>布局文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" android:orientation="horizontal" > <Button android:id="@+id/main_button" android:layout_width="match_parent" android:layout_height="137dp" android:background="@drawable/buttonl" android:text="button01" /></LinearLayout>效果截图:
0 0
- 第三章,设置按钮边框(Android)
- Android 按钮设置边框实例
- 设置button按钮边框颜色
- 使用storyboard设置按钮边框属性(颜色,宽度,圆角)
- Android 设置背景边框
- Android ImageView设置边框
- android的边框设置
- 第三章 边框
- 按钮 无边框 相关css设置
- xib中设置按钮的边框颜色
- 给按钮设置边框的实例
- Android设置上下边框,或者左右边框
- Android中GridView设置边框
- android 设置边框圆角
- android GridView设置边框教程!!
- Android设置edittext无边框
- android GridView设置边框教程!
- android控件的边框设置
- uva live 4394 String painter 区间dp
- Object-c归档使用
- Leetcode[21]-Merge Two Sorted Lists
- CPDA项目数据分析师和CDA数据分析师有什么区别?
- chrome 突然出现 ERR_PROXY_CONNECTION_FAILED
- 第三章,设置按钮边框(Android)
- 动态链接库:相关1
- Java apache上传文件
- 25条提高iOS App性能的建议和技巧
- 笔记_网络02
- VC++ 输入流迭代器
- mysql备份恢复
- 设计模式04_抽象工厂模式
- 关于C#的Type.GetType血泪史