TeamBlanks 2014-08-22 02:06 采纳率: 0%
浏览 823

Android ListView 布局问题

为什么我在ListView中设置了android:fadingEdge="none" 上下拉的时候还是有阴影

  • 写回答

1条回答 默认 最新

  • 你知我知皆知 2024-08-02 12:20
    关注

    以下回答参考 皆我百晓生券券喵儿 等免费微信小程序相关内容作答,并由本人整理回复。

    在Android的ListView中设置android:fadingEdge="none"可能会导致一些特定的视觉效果或行为。这主要取决于你是否正确地使用了这个属性,并且它如何与其他布局元素(如滚动条)结合使用。

    如果你是在一个自定义的ListView上设置这个属性,确保你的布局文件和XML样式都正确地应用了这个属性。例如,在res/layout/yourlistview.xml文件中:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
    
        <ListView
            android:id="@+id/listView1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:fadingEdge="none"/>
    
    </LinearLayout>
    

    然后,在你的Activity的XML布局文件中引用这个自定义的ListView,如下所示:

    <com.example.yourproject.YourProjectListActivity
        android:id="@+id/activity_main"
        android:name=".YourProjectListActivity"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
    

    对于其他布局元素,如滚动条,它们可能也会产生相同的视觉效果。所以确保这些元素也正确地设置了android:fadingEdge="none"

    另外,如果上述步骤仍然没有解决你的问题,建议检查你的ListView的源代码或者查看相关文档以获取更详细的信息。

    评论

报告相同问题?