java - 在 Android 布局中插入列线

标签 java android android-layout layout user-interface

我正在尝试在 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/

相关文章:

android - 最佳实践 : Ensuring Backward compatibility with Push Notifications

android - 我如何引用android :gravity values in a resource file?

android - 在弹出窗口外单击时,如何关闭弹出窗口?

android - 当键盘打开时,布局应该在 android 中移动到上方

java - 如何获取 Groovy 生成的 java 源代码

java - 如何获取泛型类型的类?

java - 如何使用java解析html列表值

java - InternetDomainName 和 publicsuffix 列表

android - 是否可以在 Android 应用程序的后台服务中使用 C 库?

android - CountDownTimer 与 AlarmManager