zoukankan      html  css  js  c++  java
  • android listview 禁止滚动

    在一个项目中,使用了listview和3个include 布局。

    结果发现listview为 wrap_content 时,无法撑开布局。但是所有布局并未占满屏幕。另外,在include中调用软键盘时,listview依然不动,导致编辑内容的位置比较别扭。

    反复试验,总结就是为listview设置高度。但是似乎   listview.setOverScrollMode(View.OVER_SCROLL_NEVER);  不起作用。 布局代码如下:

    (由于 ScrollView 内部只能有一个元素,因此用linearLayout 包括其它元素。)

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
    android:layout_height="match_parent" android:orientation="vertical" > <Toolbar android:id="@+id/stb" android:layout_width="match_parent"
    android:layout_height="wrap_content" /> <ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:orientation="vertical" android:layout_height="wrap_content"> <ListView android:id="@+id/plv" android:layout_width="match_parent" android:layout_height="230dp" tools:ignore="NestedScrolling" /> <include android:id="@+id/plable" layout="@layout/style_lable" /> <include android:id="@+id/poffset" layout="@layout/price_offset" /> <include android:id="@+id/pedit" layout="@layout/style_edit" /> </LinearLayout> </ScrollView> </LinearLayout>

         
        
  • 相关阅读:
    烂笔头@WP 的博文仅供自己学习的备忘录
    工具---搜索
    ubuntu---安装teamviewer和向日葵
    Ubuntu---标注工具 XXX-labelImg
    ubuntu---深度学习标注工具CasiaLabeler
    ubuntu---kazam安装
    ubuntu---notepadqq安装
    ubuntu---TeamViewer安装
    ubuntu---鼠标的乌龙事件
    ubuntu---终端下不显示 中文文字 的解决方法
  • 原文地址:https://www.cnblogs.com/htsky/p/11370925.html
Copyright © 2011-2022 走看看