【问题标题】:create custom shape with android studio? [duplicate]使用 android studio 创建自定义形状? [复制]
【发布时间】:2019-07-06 19:52:09
【问题描述】:

我想为我的应用创建这个形状,但我无法在编辑器中创建这个形状

【问题讨论】:

  • 你应该可以为此制作九个补丁

标签: android


【解决方案1】:

创建一个名为bg_custom_textview.xml的drawable

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

<solid android:color="@color/SomeColor"
        />
<corners
        android:topLeftRadius="10dp"
        android:topRightRadius="10dp"
        />
</shape>

使用它作为你的文本视图背景,

<TextView
android:background="@drawable/bg_custom_textview"
/>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-11-01
    • 2019-03-10
    • 1970-01-01
    • 1970-01-01
    • 2015-02-16
    • 1970-01-01
    • 2014-12-06
    • 1970-01-01
    相关资源
    最近更新 更多