前往Shuct.Net首页

Shudepb PB反编译专家长时间以来,为业内同类软件事实上的唯一选择.细节,彰显专业.态度,决定品质.

关于反编译的搜索

android shape的使用详解以及常用效果(渐变色、分割线、边框、半透明阴影效果等)--aloysius的文章--CFANZ社区--IT技术分享网站 CFANZ 文章 图库 文库 视频 小组 成员 注册 登录 收藏(0) 推荐(0) 关注(1) 回应(0) android shape的使用详解以及常用效果(渐变色、分割线、边框、半透明阴影效果等) 发布者:aloysius 他的主页 关注的信息 收藏的信息 推荐的信息 参加的群组 时间:2014-03-08 17:44:47 shape使用、渐变色、分割线、边框、半透明、半透明阴影效果。 首先简单了解一下shape中常见的属性。(详细介绍参看 api文档) 转载请注明:Rflyee_大飞:http://blog.csdn.net/rflyee/article/details/20785495 <?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape=["rectangle" | "oval" | "line" | "ring"] > --- 默认为rectangle <corners -- shape=“rectangle”时使用, android:radius="integer" -- 半径,会被下边的属性覆盖,默认为1dp, android:topLeftRadius="integer" android:topRightRadius="integer" android:bottomLeftRadius="integer" android:bottomRightRadius="integer" /> <gradient -- 渐变 android:angle="integer" android:centerX="integer" android:centerY="integer" android:centerColor="integer" android:endColor="color" android:gradientRadius="integer" android:startColor="color" android:type=["linear" | "radial" | "sweep"] android:useLevel=["true" | "false"] /> <padding android:left="integer" android:top="integer" android:right="integer" android:bottom="integer" /> <size -- 指定大小,一般用在imageview配合scaleType属性使用。大小一般会适配滴 android:width="integer" android:height="integer" /> <solid -- 填充颜色,可是是十六进制颜色。(比如想设置半透明效果,直接使用十六就只就OK) android:color="color" /> <stroke -- 指定边框,border,dashWidth和dashGap有一个为0dp则为 android:width="integer" android:color="color" android:dashWidth="integer" -- 虚线宽度 android:dashGap="integer" /> -- 虚线间隔宽度</shape> 注意: <corners> 1、android:radius,半径,会被下边的单个角度半径属性覆盖,默认为1dp, 2、在使用时,如果单独设置四个角度,又大小不一致时,eclipse的graphics preview会报错。但是直接真机运行即可。(比如实线上边直角,下边屈角的效果) <size> Note: The shape scales to the size of the container View proportionate to the dimensions defined here, by default. When you use the shape in an ImageView, you can restrict scaling by setting the android:scaleType to "center" 举个栗子: 1、渐变色 res/drawable/gradient_box.xml: <?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="#FFFF0000" android:endColor="#80FF00FF" android:angle="45"/> <padding android:left="7dp" android:top="7dp" android:right="7dp" android:bottom="7dp" /> <corners android:radius="8dp" /></shape> 如图: 2、白色边框、半透明效果 <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <corners android:radius="16dp" /> <!-- 这是半透明,还可以设置全透明,那就是白色边框的效果了 --> <solid android:color="#80065e8d" /> <stroke android:dashGap="0dp" android:width="4dp" android:color="@android:color/white" /> </shape> 如图: 3、分割线效果: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line" > <stroke android:width="4dp" android:color="@android:color/black" /> </shape> 如果: 4、单边屈角效果 <?xml version="1.0" encoding="utf-8"?> <shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:topLeftRadius="5dp" android:topRightRadius="5dp" android:bottomLeftRadius="30dp" android:bottomRightRadius="30dp"/> <!-- 这是半透明,还可以设置全透明,那就是白色边框的效果了 --> <solid android:color="#ff065e8d" /> <stroke android:dashGap="0dp" android:width="4dp" android:color="@android:color/white" /> </shape> 如图: 另:附上一份颜色进制图,需要的可以查阅:http://blog.sina.com.cn/s/blog_684a1d160100umuq.html 转载请注明:Rflyee_大飞:http://blog.csdn.net/rflyee/article/details/20785495 标签: shape 边框 分割线 半透明 背景 相关信息 更多 Android中的Handler详解以及和Thread的区别 Android APK反编译详解 [深入浅出Cocoa]详解键值观察(KVO)及其实现机理 Apk文件如何安装到Android模拟器的方法详解 Notification及NotificationManager的使用详解 Android Manifest.xml 结构详解 Android 程序清单文件详解 Android sqlite 基本操作 详解 Android Manifest.xml文件详解 android状态机statemachine详解 显示游标的使用详解 Android Animations动画使用详解 Android中的Intent详解 Android TraceView工具使用详解 Android APK反编译详解(附图) Android WebView缓存策略详解 {#if $T.total > 0 && $T.page {#foreach $T.data as r} {$T.r.formt_tm}{#if $T.r.nickname}{$T.r.nickname}{#else}匿名{#/if} {$T.r.content} {#/for} {#if $T.page > 1 && $T.pageNum > 1) 1 ? $T.page -1 : 1}">上一页 {#/if} 1 {#if $T.s_num > 2} ... {#/if} {#for index = $T.s_num to $T.e_num} {$T.index} {#/for} {#if $T.pageNum > $T.pageNavSize+ 2 && $T.s_num != $T.pageNum - $T.pageNavSize} ... {#/if} {#if $T.pageNum > 1} {$T.pageNum} {#/if} {#if $T.pageNum != $T.page && $T.pageNum > 1} 下一页 {#/if} {#/if} 您的回应... 提交 也许你感兴趣 换一批 Minim on Behance 来自:图片 关注度:8 UIPageControl 小点图片更换 来自:文章 关注度:8 static 和 extern 关键字 来自:文章 关注度:8 解读Photoshop等高线 来自:文章 关注度:8 开始Equinox 官方翻译+个人解释 来自:文章 关注度:8 3.2栈的应用举例----数制转换及括号匹配 来自:文章 关注度:8 09年全球87%电子邮件为垃圾邮件 来自:文章 关注度:8 Web Design:The Work of Justin Carroll 来自:图片 关注度:8 Win7系统声音设置,工作娱乐无打扰 来自:文章 关注度:8 用大海和沙滩,记录我们走了多远 来自:图片 关注度:8 JDBC简介 来自:文章 关注度:8 高性能嵌入式WiFi模块--WizFi630简介、操作模式及应用参考 来自:文章 关注度:8 VS2010给Activex添加接口 来自:文章 关注度:8 TriQuint推出新型氮化镓 (GaN) 集成功率倍增器 来自:文章 关注度:8 简单的malloc分配器设计 来自:文章 关注度:8 Dynamics CRM 2011 编程系列(29):自定义页面 来自:文章 关注度:8 ios通过代码控制,各个控件的圆角情况 来自:文章 关注度:8 三数据比较大小 来自:文章 关注度:8 DC|Typography;Type Design 来自:图片 关注度:8 第二章 一切都是对象 来自:文章 关注度:8 Linux中getopt函数用法 来自:文章 关注度:8 Windows phone 7之XAML 来自:文章 关注度:8 Ubuntu下安装usbview 来自:文章 关注度:8 Fedora 14 下MySQL的安装及使用 来自:文章 关注度:8 mysql 事件 存储过程 Can&#39;t create a PROCEDURE from within another stored routine 来自:文章 关注度:8 长见识了~~全世界最早注册的域名 来自:文章 关注度:8 ! 来自:图片 关注度:8 squid日志分析软件sarg 来自:文章 关注度:8 sqlplus中显示sql执行计划和统计信息 来自:文章 关注度:8 Grub Rescue出现的问题及解决方案 来自:文章 关注度:8 yearbook showstopper 来自:图片 关注度:8 HDU2054(大数的处理) 来自:文章 关注度:8 Glance源码架构探秘(一) 来自:文章 关注度:8 oracle11g flashback archive feature新特性 来自:文章 关注度:8 Google WebGL让浏览器支持3D 三款应用大开眼界 来自:文章 关注度:8 查看《Colorful?Squircle》原图,原图尺寸:600x1400 来自:图片 关注度:8 有一天你将破蛹而出,成长得比人们期待的还要美丽,但这个过程会很痛,会很辛苦,有时候还会觉得灰心。面对着汹涌而来的现实觉得 ADO.NET结构 古风图片:寂候彼岸花开(6) APP UI 广告精选-榆木111采集到完美排版-花瓣 几种san架构选择对比 热门标签 更多 Android Linux Java 实现 开发 方法 windows 服务器 问题 解决 文件 设计 网络 配置 安装 发布 安全 函数 系统 微软 推出 技术 分析 程序 Photoshop 存储 软件 操作 oracle 手机 关于我们 人才招聘 联系我们 免责声明 帮助中心 网站地图 RSS订阅 API ?2012 本站提供的内容来源于广大网络用户,我们不保证内容的正确性。如果转载了您的内容,希望删除的请联系我们!