【问题标题】:How to make this arc?这个弧线怎么画?
【发布时间】:2016-08-11 12:23:54
【问题描述】:

我尝试创建这个视图:

我不知道如何用线画弧线。我尝试了一些shape 和属性radius 但不起作用。

【问题讨论】:

  • 自定义View 并在onDraw 方法中进行绘图

标签: android xml view


【解决方案1】:

您可以像这样创建视图的半圆:

?xml version="1.0" encoding="utf-8"?>
<clip
xmlns:android="http://schemas.android.com/apk/res/android"
android:clipOrientation="vertical"
android:gravity="bottom">
<shape android:shape="oval">
    <solid android:color="#444"/>
</shape>

【讨论】:

    猜你喜欢
    • 2012-07-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-02
    • 2012-07-10
    • 1970-01-01
    • 2018-12-27
    • 1970-01-01
    相关资源
    最近更新 更多