我正在尝试在 Android 应用程序中插入垂直线,但在如何操作方面遇到了问题。
我的布局目前设计为表格和行布局,这已经完成。谁能建议在布局上插入横跨多个表行的垂直线的最佳方法?我不能做中间有间距的背景颜色,因为最后一个是不同的颜色和虚线。
最佳答案
我不确定,但会尝试使用此代码。比如
水平线
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:layout_marginBottom="3dp"
android:layout_marginTop="3dp"
android:background="#000000" />
垂直线
<View
android:layout_width="1dip"
android:layout_height="fill_parent"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
android:background="#000000" />
在这里您可以根据您的需求控制边距和填充。祝你好运。
关于java - 在 Android 布局中插入列线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12483772/