繁体   English   中英

分频器在我的列表视图中不起作用

[英]Divider not working in my listview

我正在尝试在我的简单列表视图中使用梯度除法器。 但这根本行不通。

布局xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    android:id="@+id/main_layout"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/wood_small"
    android:padding="5dip" xmlns:android="http://schemas.android.com/apk/res/android">

    <ImageView android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        android:id="@+id/masthead_image" android:layout_gravity="center_horizontal" 
        android:src="@drawable/tavi_mh_copy">
    </ImageView>

    <ListView  android:id="@+id/station_list" 
        android:layout_height="fill_parent" android:layout_width="fill_parent"
        android:divider="@drawable/black_white_gradient" android:dividerHeight="2px">
    </ListView>

</LinearLayout>

分频器Xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
  <gradient
      android:startColor="#00222222"
      android:centerColor="#FFFFFFFF"
      android:endColor="#00222222"
      android:angle="0" />
</shape>

解决了此问题。不确定是否能正常工作,但我重新创建了相同的布局并开始工作。 也许这是星星的位置或其他东西。

谢谢大家,Droidment

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM