• listview不会自动向上滚动,会遮盖内容


    在使用listView显示聊天窗口时,弹出输入法,listview不会自动向上滚动,会遮盖内容,在manifest中的Activity加入:

    1
    android:windowSoftInputMode="adjustResize"

    也无法解决问题。

    通过百度,找到一位童鞋的博客:http://blog.sina.com.cn/s/blog_9564cb6e0101g2eg.html

    解决了我的问题。

    原来的ListView布局如下:

    <ListView
            
    android:id="@+id/lv_suggestion_list"
            android:layout_width
    ="match_parent"
            android:layout_height
    ="wrap_content"
            android:layout_above
    ="@id/bottom_suggestion"
            android:layout_below
    ="@id/title_suggestion"
            android:cacheColorHint
    ="#00000000"
            android:divider
    ="@color/transparent"
            android:dividerHeight
    ="8dp"
            android:listSelector
    ="@color/transparent"
            android:paddingBottom
    ="4dp"
            android:paddingTop
    ="4dp" />

    修改过后的ListView布局如下:

     1 <ListView
     2         android:id="@+id/lv_suggestion_list"
     3         android:layout_width="match_parent"
     4         android:layout_height="wrap_content"
     5         android:layout_above="@id/bottom_suggestion"
     6         android:layout_below="@id/title_suggestion"
     7         android:cacheColorHint="#00000000"
     8         android:divider="@color/transparent"
     9         android:dividerHeight="8dp"
    10         android:listSelector="@color/transparent"
    11         android:fastScrollEnabled="true"
    12         android:scrollbarStyle="insideInset"
    13         android:transcriptMode="normal" />

    其中加入了这三个属性:

    android:fastScrollEnabled="true"
    android:scrollbarStyle="insideInset"
    android:transcriptMode="normal"
  • 相关阅读:
    Enum, Generic and Templates
    Writing A Threadpool in Rust
    A First Look at Rust Language
    Closures in OOC
    Complexity Behind Closure
    Introduction to OOC Programming Language
    OOC,泛型,糟糕的设计。
    Enlightenment笔记
    Machine Learning/Random Projection
    Machine Learning/Introducing Logistic Function
  • 原文地址:https://www.cnblogs.com/shaoke123/p/4503809.html
Copyright © 2020-2023  润新知