main.xml中:
<?xml version="1.0" enCoding="utf-8"?><linearLayout androID:ID="@+ID/linearLayout01" androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent" xmlns:androID="http://schemas.androID.com/apk/res/androID"> <ListVIEw androID:layout_height="fill_parent" androID:layout_wIDth="fill_parent" androID:ID="@+ID/androID:List"></ListVIEw> <TextVIEw androID:layout_height="fill_parent" androID:layout_wIDth="fill_parent" androID:text="@string/List_no_items" androID:ID="@+ID/androID:empty"></TextVIEw></linearLayout>
row.xml:
<linearLayout androID:ID="@+ID/linearLayout01" androID:layout_wIDth="fill_parent" androID:layout_height="?androID:attr/ListPreferredItemHeight" androID:padding="6dip" xmlns:androID="http://schemas.androID.com/apk/res/androID"> <ImageVIEw androID:ID="@+ID/icon" androID:layout_wIDth="wrap_content" androID:layout_height="fill_parent" androID:layout_marginRight="6dip" androID:src="@drawable/icon" /> <linearLayout androID:orIEntation="vertical" androID:layout_wIDth="0dip" androID:layout_weight="1" androID:layout_height="fill_parent"> <TextVIEw androID:ID="@+ID/toptext" androID:layout_wIDth="fill_parent" androID:layout_height="0dip" androID:layout_weight="1" androID:gravity="center_vertical" /> <TextVIEw androID:layout_wIDth="fill_parent" androID:layout_height="0dip" androID:layout_weight="1" androID:ID="@+ID/bottomtext" androID:singleline="true" androID:ellipsize="marquee" /> </linearLayout></linearLayout>
然后我有一个适配器,它基本上采用一个Manga对象并将其名称放在行toptext中,并且它是最新更新的日期.但是,(这可能是由于单元的虚拟化引起的),结果非常慢.滚动列表需要永远,你只能滚动时间的小和平.如何使列表与contacts-app中的列表一样工作?因此,当你开始滚动时,屏幕右侧d出一个手柄,当你拖动它时,字母会显示你滚动的距离(列表按字母顺序排序),还有,有一种方法我可以提高名单的表现吗?
解决方法 要添加拇指滚动条,请在main.xml中调整ListVIEw,如下所示:<ListVIEw androID:layout_height="fill_parent" androID:layout_wIDth="fill_parent" androID:ID="@+ID/androID:List" androID:fastScrollEnabled="true"></ListVIEw>
添加androID:fastScrollEnabled =“true”属性.
https://developer.android.com/reference/android/widget/AbsListView.html#attr_android:fastScrollEnabled
你也可以看看使用SectionIndexer.
总结以上是内存溢出为你收集整理的在android上的联系方式,如滚动列表全部内容,希望文章能够帮你解决在android上的联系方式,如滚动列表所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)