使用View来在Widget中创建分隔符

时间:2017-03-09 19:38:10

标签: android view

我想在Widget中使用垂直分隔符,但View禁止使用Widget元素。

他们是否有其他类似的解决方案?

<View
    android:layout_width="2px"
    android:layout_height="match_parent"
    android:background="#496185"/>

1 个答案:

答案 0 :(得分:0)

我使用RelativeLayout代替View找到了解决方案:

<RelativeLayout
        android:layout_width="2dp"
        android:layout_height="match_parent"
        android:background="#496185"/>