2016-08-19 90 views
0

此背景绘制我需要做这样的背景下为TextView(水平线交叉的看法,但没有重叠文本)在Android中,我想我应该有一个形状做,但我不知道如何。不要在安卓

任何人有一个好方法呢?

image

回答

-1

enter image description here

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/base" 
    android:layout_width="match_parent" 
    android:layout_height="100dp" 
    android:layout_margin="10dp" 
    android:background="@color/white" 
    android:orientation="horizontal" 
    android:weightSum="10"> 


    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="100dp"> 

     <View 
      android:id="@+id/view" 
      android:layout_width="match_parent" 
      android:layout_height="1dp" 
      android:layout_alignParentStart="true" 
      android:layout_centerVertical="true" 
      android:background="@android:color/black"></View> 

     <View 
      android:id="@+id/vieaw" 
      android:layout_width="1dp" 
      android:layout_height="match_parent" 
      android:layout_alignParentStart="true" 
      android:layout_centerVertical="true" 
      android:background="@android:color/black"></View> 

     <View 
      android:id="@+id/vieaaw" 
      android:layout_width="1dp" 
      android:layout_height="match_parent" 
      android:layout_centerVertical="true" 
      android:background="@android:color/black" 
      android:layout_alignParentEnd="true"></View> 

     <TextView 
      android:id="@+id/textView" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_centerHorizontal="true" 
      android:layout_centerVertical="true" 
      android:paddingRight="10dp" 
      android:paddingLeft="10dp" 
      android:background="@color/white" 
      android:text="12 ABCDFE GHI" /> 
    </RelativeLayout> 
</FrameLayout> 
+0

你认为可以做到人无添加更多的意见?只是设置绘制作为背景的TextView? – colymore

+0

它已完成并显示在上面。你不认为它的简单 –

+0

如果它帮助,然后投票或剔标记。 –