如何改变边界进入泡沫卡通 [英] how to change border into bubble cartoon
问题描述
所以我想我的布局边境改变某种泡沫像漫画/漫画。我知道我可以改变我的边框是这样的:
So i want to change the border of my layout to some kind of a bubble like in the comics / cartoons. I know i can change my border like this :
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle" >
<corners android:radius="5dip" />
<stroke android:width="2dip" android:color="@color/white"/>
</shape>
</item>
</layer-list>
但我可怎么办尖尖的部分(这看起来像一个三角形的)。我需要用它来点什么我拍了拍。
我知道这是奇声或搞笑,但我需要去尝试。
but how i can do the pointy part (the one which looks like a triangle). I need to use it to point what i tapped on. I know it's sound odd or funny, but i need to try.
推荐答案
没有,你不能这样做。您可以提供的行程角的,但没有复杂的曲线(三角形),对于自定义形状,您可以使用视图和的onDraw()
No, you can't do that. You can provide Stroke Corner but no complex curve(triangle), For custom shape you can use view and in onDraw()
Path path = new Path();
path.moveTo(160.0f, 240.0f);
path.lineTo(140.0f, 200.0f);
path.addArc(new RectF(140, 180, 180, 220), -180, 180);
path.lineTo(160.0f, 240.0f);
path.close();
这条道路将使用帆布画,
This path will draw in canvas using,
canvas.drawPath(路径,油漆);
最好创建图像的 9Patch
的概念。
Better to create image with 9Patch
concept.
该工具将帮助轻松 HTTP建立9Patch形象://机器人.elex.pe.kr / A-更好9补丁工具
这篇关于如何改变边界进入泡沫卡通的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!