2016-08-19 33 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

如果它幫助,然後投票或剔標記。 –