欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

android xml png,android - 使用.png文件中的形状创建xml聊天气泡 - 堆栈内存溢出

发布时间:2025/4/5 编程问答 52 豆豆
生活随笔 收集整理的这篇文章主要介绍了 android xml png,android - 使用.png文件中的形状创建xml聊天气泡 - 堆栈内存溢出 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

请问是否有人知道如何在下面创建聊天气泡的xml形状? 我在网上找到的唯一示例是两个单独的形状,它们在布局中作为两个单独的背景放置-三角形和矩形。 我尝试将三角形和矩形组合在一起无济于事。 三角形似乎隐藏在矩形中。 将三角形的top属性设置为向下移动会使ImageView对象为空白。

请查看我尝试过的内容:

android:shape="rectangle">

android:width="106dp"

android:height="20dp"/>

android:width="1dp"

android:color="#000" />

android:fromDegrees="45"

android:toDegrees="45"

android:pivotX="135%"

android:pivotY="15%">

android:height="10dp"

android:width="10dp"/>

这是imageView中的用法:

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:paddingBottom="@dimen/activity_vertical_margin"

android:paddingLeft="@dimen/activity_horizontal_margin"

android:paddingRight="@dimen/activity_horizontal_margin"

android:paddingTop="@dimen/activity_vertical_margin"

tools:context="net.eventilate.shapes.Balloon">

android:layout_width="106dp"

android:layout_height="30dp"

android:id="@+id/imageView2"

android:contentDescription="@string/test"

android:background="@drawable/balloon"

android:layout_centerVertical="true"

android:layout_centerHorizontal="true" />

总结

以上是生活随笔为你收集整理的android xml png,android - 使用.png文件中的形状创建xml聊天气泡 - 堆栈内存溢出的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。