回答
作秀像上面的輸出圖像
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#eeeeee"
android:orientation="horizontal" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="E"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:background="@android:color/white"
android:layout_marginRight="5dp" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="F"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:background="@android:color/white"
android:layout_marginRight="5dp" />
</LinearLayout>
我覺得你可以的把三Views
與顏色實現這一點,你要
像
<View
android:layout_height="wrap_content"
android:layout_width="1dip"
android:background="#f3f3f3"
/>
layout_height = 「match_parent」,但除此之外,我同意。 ImageView更多功能;但如果你不想要任何花哨的東西,這個輕巧簡單。 –
但我有Android:layout_width =「0px」 android:layout_weight =「1」使所有視圖具有相同的空間量 –
@forsubhi不要把這個視圖的任何重量我已經試過它與我的代碼工作得很好。 – amDroid
如果你想要一個自定義分隔符,請使用separ ator.xml在繪製
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<gradient
android:angle="90"
android:centerColor="#ffffffff"
android:endColor="#00ffffff"
android:startColor="#00ffffff" />
</shape>
然後參考該分離器形狀與此
<ImageView
android:id="@+id/imageView1"
android:layout_width="2dip"
android:layout_height="fill_parent"
android:layout_marginLeft="4dip"
android:layout_marginRight="4dip"
android:src="@drawable/seperator" />
結果:
要創建的Android,我們的邊界必須在形狀中使用中風標籤(xml繪製)
這裏是我的代碼,我在我的結束已經測試:
stroke_background.xml
<stroke android:width="1dp"
android:color="@android:color/darker_gray"/>
<solid android:color="#ffffff"/>
</shape>
佈局您需要
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:weightSum="1">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight=".5"
android:background="@drawable/stroke_background">
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="E" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/stroke_background"
android:layout_weight=".5"
>
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="F" />
</LinearLayout>
</LinearLayout>
結果是這樣的..
- 1. 圖像和邊界之間的填充
- 2. 刪除CPTPiechart的外邊界線,但需要餅圖片之間的邊界線
- 3. li元素之間的邊界線
- 4. 如何使用全寬圖像作爲內容和頁腳之間的邊界
- 5. 邊界圖像的線性漸變
- 6. 如何在JHeatChart熱圖圖表中設置小像素邊界線?
- 7. 在頁面頂部的圖像邊界之間的差距html
- 8. 找到兩個圖像之間的差異的邊界框?
- 9. 如何使用重複圖像作爲邊界與間隙
- 10. 使圖像成爲「邊界」
- 11. 使用引導3添加邊界之間的邊界
- 12. 視圖的框架和視圖的邊界之間的區別+ iPhone
- 13. 如何隱藏html表中的行之間的邊界,並使用css僅顯示列之間的邊界
- 14. 如何讓我的沿曲線圖像的邊界?
- 15. 如何在散點圖上填充上下邊界曲線之間的區域
- 16. 圖像邊界圖像php
- 17. 所述的UIImage視圖超過表視圖小區的邊界
- 18. 更改圖像的邊界取決於圖像的大小
- 19. IE9圖像邊界
- 20. grid.arrange之間的邊界之間的邊距
- 21. phpexcel刪除2個單元格之間的中間邊界線?
- 22. Android - 文本視圖之間的分界線
- 23. 如何RippleDrawable平局視圖邊界之外
- 24. 傳單圖像映射到風景視口的邊界視圖
- 25. 如何擺脫圖像邊界?
- 26. 計算邊界圖像寬度與邊界圖像首先
- 27. 圖像的邊界底部
- 28. 古怪的圖像邊界
- 29. 邊界前的圖像
- 30. 捕獲圖像的邊界?
非常非常感謝你的人,你是輝煌 –
我有這樣的新問題http://stackoverflow.com/questions/14539670/i-want-to-make-separator-like-the-following –