【问题标题】:Chat Bubble background Xml聊天气泡背景 Xml
【发布时间】:2020-06-25 06:58:28
【问题描述】:

我正在尝试创建聊天可绘制背景,但不是仅用于查看聊天。尝试使用一些无法完全按照要求实现的代码。请帮我完成这个。

所需图片:

我的代码:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

<item>
    <rotate
        android:fromDegrees="45"
        android:pivotX="0%"
        android:pivotY="100%"
        android:toDegrees="0" >
        <shape android:shape="rectangle" >
            <solid android:color="@color/colorWhite" />
        </shape>
    </rotate>
</item>

<item android:left="20dp">
    <shape android:shape="rectangle" >
        <solid android:color="@color/colorWhite" />
        <corners android:radius="5dp" />
    </shape>
</item>

【问题讨论】:

    标签: android xml android-layout drawable


    【解决方案1】:

    试试这个

    <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    
        <item>
            <rotate
                android:fromDegrees="45"
                android:pivotX="0%"
                android:pivotY="10%"
                android:toDegrees="0">
                <shape android:shape="rectangle">
                    <solid android:color="@color/colorBlack" />
                </shape>
            </rotate>
        </item>
    
        <item
    
            android:top="50dp">
            <shape android:shape="rectangle">
                <solid android:color="@color/colorWhite" />
                <corners android:radius="5dp" />
            </shape>
        </item>
    </layer-list>
    

    【讨论】:

    猜你喜欢
    • 2021-12-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-19
    • 2018-11-01
    • 2022-11-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多