我想在我的應用程序的表格佈局中顯示虛線邊距。 可能嗎? 如果是,那麼如何..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 GridView外邊距
- 2. Android:降低NumberPicker的邊距
- 3. Android佈局中的摺疊邊距
- 4. Android無邊距對話框
- 5. Android的表格佈局無邊距
- 6. jsqmessageviewcontroller中的customMediaItem的邊距
- 7. Dreamweaver中圖像旁邊的大邊距?
- 8. 帶有上邊距的CSS邊距自動居中 - VALID?
- 9. webkit中的邊距問題
- 10. webview中的視頻邊距
- 11. ConstraintLayout中的邊距行爲
- 12. DOMPDF中的打印邊距
- 13. Android AppCompatCheckbox填充/邊距/重力
- 14. Android - 微調器默認邊距
- 15. Android TabWidget文本邊距/填充
- 16. Android列表視圖行邊距
- 17. android ConstraintLayout不允許負邊距
- 18. Android - ImageView邊距不出現在LinearLayout
- 19. Android導航抽屜左邊距
- 20. Android支持工具欄標題邊距
- 21. 邊距或填充間距?
- 22. iFrame上的邊距
- 23. jQuery的 - 邊距鉻
- 24. 帶邊距的BackgroundImage
- 25. 在編輯文本中的邊距在android中
- 26. Android Studio中抽屜菜單中第一項的上邊距
- 27. 大頁邊距
- 28. Matplotlib邊距
- 29. QT QSlider邊距
- 30. GridLayout空邊距
我是新來的機器人。我不知道如何實現這一點。 你可以有一個相關的例子或任何好的教程? – 2011-02-17 11:22:47