首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我怎样才能创建弯曲的视图?

我怎样才能创建弯曲的视图?
EN

Stack Overflow用户
提问于 2020-03-17 12:29:46
回答 1查看 34关注 0票数 0

我正在制作电影票应用程序,现在我需要创建一个像这样模糊阴影的弧形视图:

有办法做到这一点吗?

我试过用x轴旋转图像(-45%),但这不是我所需要的。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-03-17 13:07:32

如@naggab的评论所示,您应该包括此图像

但是,我也尝试使用下面的代码来实现这一点

代码语言:javascript
复制
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="oval">
            <solid android:color="@color/white" />
            <size
                android:width="450dp"
                android:height="110dp" />
        </shape>
    </item>
    <item android:top="50dp">
        <shape android:shape="rectangle">
            <solid android:color="@color/colorPrimary" />
        </shape>
    </item>

    <item android:top="20dp">
        <shape android:shape="oval">
            <solid android:color="@color/colorPrimary" />
            <size
                android:width="450dp"
                android:height="110dp" />
        </shape>
    </item>
    <item android:top="50dp">
        <rotate
            android:fromDegrees="4"
            android:toDegrees="45">
            <shape android:shape="rectangle">
                <solid android:color="@color/colorPrimary" />
            </shape>
        </rotate>
    </item>
    <item android:top="50dp">
        <rotate
            android:fromDegrees="-4"
            android:toDegrees="45">
            <shape android:shape="rectangle">
                <solid android:color="@color/colorPrimary" />
            </shape>
        </rotate>
    </item>

</layer-list>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60722475

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档