定製 黑色描邊、白色背景、帶圓角 的背景,描邊圓角

來源:互聯網
上載者:User

定製 黑色描邊、白色背景、帶圓角 的背景,描邊圓角

首先,在drawable檔案夾寫一個xml檔案solid_c9c9c9.xml

1 <?xml version="1.0" encoding="utf-8"?>2 <shape xmlns:android="http://schemas.android.com/apk/res/android">3     android:shape="rectangle"><!--方形-->4     <stroke5         android:width="1dp"6         android:color="@color/color_c9c9c9" /><!--描邊-->7     <solid android:color="@color/white" /><!--背景-->8     <corners android:radius="5dp" /><!--圓角-->9 </shape>
View Code

然後,在布局檔案中直接用這個xml檔案設定背景

1 <LinearLayout2         android:layout_width="match_parent"3         android:layout_height="40dp"4         android:orientation="horizontal"5         android:layout_margin="@dimen/padding_15"6         android:background="@drawable/solid_c9c9c9">7 8     </LinearLayout>
View Code

:

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.