2017-04-24 43 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 –

相关问题