在列表视图最大化可见行

编程入门 行业动态 更新时间:2024-10-25 05:25:05
本文介绍了在列表视图最大化可见行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

这是我的$ C $下列表中的项目..假设IM夸大这个TextView的进入列表视图

Heres my code for items in a list.. suppose im inflating this textview into the listview

<TextView android:id="@+id/textviewItemList" android:layout_width="fill_parent" android:layout_height="50dp" android:paddingBottom="10dip" android:paddingLeft="10dip" android:paddingTop="10dip" android:textSize="35px" />

和这里是我的$ C $下列表视图。仅有3行的RelativeLayout的内部与其他可滚动可见。 RelativeLayout的具有文本视图的高度X3的高度......

And here is my code for list view. inside a relativelayout having only 3 rows are visible with others as scrollable. relativelayout having height of x3 of the height of text view...

<RelativeLayout android:layout_width="wrap_content" android:layout_height="150dp" android:layout_marginTop="15px" android:background="@drawable/border" android:layout_centerHorizontal="true" android:orientation="vertical"> <ListView android:id="@+id/listview_data" android:layout_width="300px" android:layout_height="wrap_content" android:columnWidth="30px" android:gravity="center" android:numColumns="10"> </ListView> </RelativeLayout>

但是,当列表视图中有超过3项创建的,我得到小号滚动时下跌阴影部分或向上,但它并没有突出所有的(它有某种阴影部分或者我说的衰减部分)...

but when the listview is created with more than 3 items, i get s shadow part when scrolling down or up, it didn't highlight all (it has some kind of shadow part or i say fading part)...

推荐答案

添加机器人:cacheColorHint =#00000000在你的列表视图。这里是你的code第二段重写cacheColorHint:

Add android:cacheColorHint="#00000000" in your listview. Here's the second segment of your code rewritten with cacheColorHint:

<RelativeLayout android:layout_width="wrap_content" android:layout_height="150dp" android:layout_marginTop="15px" android:background="@drawable/border" android:layout_centerHorizontal="true" android:orientation="vertical"> <ListView android:id="@+id/listview_data" android:layout_width="300px" android:layout_height="wrap_content" android:columnWidth="30px" android:gravity="center" android:numColumns="10" android:cacheColorHint="#00000000" > </ListView> </RelativeLayout>

它消除了阴影/把你的ListView的黑屏问题。

It removes the shadow/turning the screen black problem of your listview.

更多推荐

在列表视图最大化可见行

本文发布于:2023-11-29 18:27:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1647233.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:视图   列表

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!