iis服务器助手广告广告
返回顶部
首页 > 资讯 > 移动开发 >Android自定义格式显示Button的布局思路
  • 232
分享到

Android自定义格式显示Button的布局思路

button布局Android 2022-06-06 10:06:37 232人浏览 泡泡鱼
摘要

先把来源贴上 Http://zrgiu.com/blog/2011/01/making-your-Android-app-look-better/http://www.dibb

先把来源贴上

Http://zrgiu.com/blog/2011/01/making-your-Android-app-look-better/

http://www.dibbus.com/2011/02/gradient-buttons-for-android/

http://www.dibbus.com/2011/08/even-more-gradient-buttons-for-android/

然后再让大家看看效果,这些都是xml布局文件实现的,一张图片都未曾使用。



顺便贴出几个布局文件给大家看看:
代码如下:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" >
<shape>
<solid
android:color="#449def" />
<stroke
android:width="1dp"
android:color="#2f6699" />
<corners
android:radius="3Dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
<item>
<shape>
<gradient
android:startColor="#449def"
android:endColor="#2f6699"
android:angle="270" />
<stroke
android:width="1dp"
android:color="#2f6699" />
<corners
android:radius="4dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
</selector>

代码如下:
<?xml version=”1.0″ encoding=”UTF-8″?>
<shape xmlns:android=”http://schemas.android.com/apk/res/android”>
<solid android:color=”#F000″/>
<stroke android:width=”1px” android:color=”#BB000000″ />
<padding
android:left=”10dp”
android:top=”7dp”
android:right=”10dp”
android:bottom=”7dp”
/>
<corners
android:bottomRightRadius=”5dp”
android:bottomLeftRadius=”5dp”
android:topLeftRadius=”5dp”
android:topRightRadius=”5dp”
/>
<gradient
android:angle=”90″
android:startColor=”#4747e0″
android:centerColor=”#5b5bcd”
android:endColor=”#6f6fcf”
android:type=”linear”
/>
</shape>

这里有个工程,开源

http://code.Google.com/p/android-gradients-sample/downloads/list

顺便把这两个网页给收了,说不定以后能够提供灵感或者参考

http://www.WEBdesignshock.com/CSS-button

//www.jb51.net/css/23418.html

您可能感兴趣的文章:Android编程之Button控件配合Toast控件用法分析Android定制RadioButton样式三种实现方法Android点击Button实现功能的几种方法总结Android 控件(button)对齐方法实现详解Android实现点击Button产生水波纹效果Android中的Button自定义点击效果实例代码android之自定义Toast使用方法android自定义toast(widget开发)示例android开发教程之实现toast工具类Android编程基础之简单Button事件响应综合提示控件Toast应用示例


--结束END--

本文标题: Android自定义格式显示Button的布局思路

本文链接: https://www.lsjlt.com/news/27907.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作