圓角輸入框」背景「

第一步:android

切換到Project模式下佈局

src => main => res => drawablexml

建立 Root element 格式爲shape的XMl佈局utf-8

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <padding
        android:bottom="12dp"
        android:left="12dp"
        android:right="12dp"
        android:top="12dp"/>
    <!--設置圓角-->
        <corners android:radius="180dp"/>
    <!--stroke設置描邊-->
    <stroke
        android:width="2dp"
        android:color="@android:color/darker_gray"/>
</shape>

 

第二部 element

須要的地方 設置成背景io

相關文章
相關標籤/搜索