2017-04-24 80 views

回答

0

試試這個:

第1步:創建9patch邊界圖像here空白數據

第2步:在佈局背景設置此圖像,並從頂部管理填充,左側,右側和底部

0

您可以邊框任何你想要的佈局。只是要與名稱customborder自定義佈局和添加XML代碼

<?xml version="1.0" encoding="UTF-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> 
    <corners android:radius="20dp"/> 
    <padding android:left="10dp" android:right="10dp" android:top="10dp" android:bottom="10dp"/> 
    <stroke android:width="1dp" android:color="#CCCCCC"/> 
</shape> 

然後,只需後臺添加到佈局這樣

<LinearLayout android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@drawable/customborder"> 

希望這有助於。

+0

我知道,我需要喜歡附加的圖像從左右是白色https://i.stack.imgur.com/pV804.png –

相關問題