Android毛边框效果
来源:互联网 发布:java小说阅读器源码 编辑:程序博客网 时间:2024/04/27 17:26
先看效果(注意中间的悬浮框):
因为中间部分是带有透明度的,所以不能用整张图片当背景,不仅如此,点9图片在这里也是失效的。
经过短暂的犹豫,我觉得用xml的shape试试,使用3次描边,代码如下:
<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:bottom="4dp" android:left="4dp" android:right="4dp" android:top="4dp"> <shape android:shape="rectangle"> <stroke android:width="1dp" android:color="@color/transparent_white_50" android:dashGap="3dp" android:dashWidth="1dp"/> <!-- 填充 --> <solid android:color="@color/transparent_white_30"/> </shape> </item> <!-- 描边 --> <item android:bottom="1dp" android:left="1dp" android:right="1dp" android:top="1dp"> <shape android:shape="rectangle"> <stroke android:width="1dp" android:color="@color/transparent_white_50" android:dashGap="3dp" android:dashWidth="1dp"/> <!-- 填充 --> <solid android:color="@color/transparent"/> </shape> </item> <!-- 描边 --> <item android:bottom="2dp" android:left="2dp" android:right="2dp" android:top="2dp"> <shape android:shape="rectangle"> <stroke android:width="1dp" android:color="@color/transparent_white_50" android:dashGap="3dp" android:dashWidth="1dp"/> <!-- 填充 --> <solid android:color="@color/transparent"/> </shape> </item> <!-- 描边 --> <item android:bottom="3dp" android:left="3dp" android:right="3dp" android:top="3dp"> <shape android:shape="rectangle"> <stroke android:width="1dp" android:color="@color/transparent_white_50" android:dashGap="3dp" android:dashWidth="1dp"/> <!-- 填充 --> <solid android:color="@color/transparent"/> </shape> </item></layer-list>通过使用shape,对View3次描边达到效果
0 0
- Android毛边框效果
- (译)Cocos2d_for_iPhone_1_Game_Development_Cookbook:1.14 使用AWTextureFilter实现毛边和字体阴影效果
- Bitmap毛边问题
- android 弹出框菜单效果
- c# .net 不规则窗体,无毛边
- Html5 Canvas画线有毛边解决方法
- PNG转GIF出现白色毛边解决方法
- 去除canvas 画圆的毛边
- 关于Unity3D中RenderTexture毛边的解决。
- RoundedImageView 处理图片存在毛边的问题
- android效果
- Android如何实现UIpopoverController效果(浮框效果)
- Android效果之 抽屉效果
- 【Android效果集】弹幕效果
- 【Android效果集】弹幕效果
- 【Android效果集】下雨效果
- 【Android效果集】弹幕效果
- Android模糊效果 毛玻璃效果
- English of information technology
- [小技巧] 在命令行中插入TAB键
- 【杂题】 HDOJ 4982 Goffi and Squary Partition
- apk反编译和重新打包
- 数据库—SQL—标准语言SQL
- Android毛边框效果
- java面向对象之继承
- uboot1.1.6顶层mkconfig详解
- Android4种布局详解
- 屏幕万能适配
- Qgis开发1:总则
- 转义字符 & URL
- glibc和eglibc
- python学习-错误-多行打印合并成一行