我想在我的應用程序的表格佈局中顯示虛線邊距。 可能嗎? 如果是,那麼如何..Android中的邊距
1
A
回答
1
那就試試這個
<TableRow android:layout_height="wrap_content" android:id="@+id/tableRow1" android:background="@drawable/dot"
android:layout_width="fill_parent">
<TextView android:layout_height="wrap_content"
android:layout_width="wrap_content" android:text="Your text"></TextView>
</TableRow>
我已經錶行
這將滿足您的需求量的中設置的背景虛像。
1
假設你需要給你的tablelayout 10dip的保證金。因此,而不是給予10浸的保證金就可以使用圖像使用下面的公式
像素= DPS *(密度/ 160)
我希望有與計算出的大小您所選擇的點這應該工作
0
下面是代碼
<?xml version="1.0" encoding="utf-8"?>
<TableLayout android:layout_height="wrap_content" android:stretchColumns="1"
android:id="@+id/tableLayout1" android:layout_width="wrap_content">
<TableRow android:layout_height="wrap_content" android:id="@+id/tableRow1"
android:layout_width="fill_parent">
<ImageView android:layout_width="wrap_content" android:src="@drawable/dot"
android:layout_height="fill_parent"></ImageView>
<TextView android:layout_height="wrap_content"
android:layout_width="wrap_content" android:text="Your text"></TextView>
<ImageView android:layout_width="wrap_content" android:src="@drawable/dot"
android:layout_height="fill_parent"></ImageView>
</TableRow>
</TableLayout>
+0
非常感謝。在你使用這個公式的地方=>像素= DPS *(密度/ 160)? – 2011-02-17 11:59:26
+0
那麼,我沒有使用過,我已經應用了四處看看和更好的解決方案...反正這是否滿足您的要求? – 2011-02-17 12:04:42
相關問題
- 1. 在android中添加邊距
- 2. Android GridView外邊距
- 3. Android:降低NumberPicker的邊距
- 4. 動態textView中的邊距Android
- 5. Android佈局中的摺疊邊距
- 6. Android:在形狀中描邊創建描邊寬度的邊距
- 7. 邊距未Android平臺2.2
- 8. Android無邊距對話框
- 9. Android和無邊距紋波
- 10. SSCollectionView邊距/間距
- 11. Android SuperSLiM:部分之間的邊距
- 12. 帶邊距的Android繪圖線
- 13. Android的表格佈局無邊距
- 14. Android:設置TableRow內容的邊距(意味着:列之間的邊距)
- 15. jsqmessageviewcontroller中的customMediaItem的邊距
- 16. 在CSS中的邊框邊距?
- 17. Dreamweaver中圖像旁邊的大邊距?
- 18. 帶有上邊距的CSS邊距自動居中 - VALID?
- 19. Flexbox中的邊距摺疊
- 20. DOMPDF中的打印邊距
- 21. webkit中的邊距問題
- 22. IE8中的虛構邊距?
- 23. 在Opera中的CSS邊距
- 24. ConstraintLayout中的邊距行爲
- 25. webview中的視頻邊距
- 26. CSS中的對齊/邊距
- 27. CKEditor中的圖像邊距
- 28. 如何更改Android對話框邊距(到屏幕邊緣的距離)?
- 29. 下邊距和邊距不起作用
- 30. 邊界佈局間距/邊距
我是新來的機器人。我不知道如何實現這一點。 你可以有一個相關的例子或任何好的教程? – 2011-02-17 11:22:47