Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the special properties of Android ListView?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail what are the special attributes of Android ListView, and the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Since I have been doing listView things these two days, I have sorted out some properties that I personally think are quite special. By setting such properties, we can make a more beautiful list.

first

The stackFromBottom attribute, which is the only attribute after which the list you have made will be displayed at the bottom of your list, with values of true and false

Android:stackFromBottom= "true"

Second

TransciptMode property, you need to use ListView or other controls that display a large number of Items to track or view information in real time, and you want the * * entries to be scrolled automatically to the visual range. By setting the transcriptMode property of the control, you can automatically slide the control of the Android platform (which supports ScrollBar) to the * * section.

Android:transcriptMode= "alwaysScroll"

Third

CacheColorHint property, many people want to be able to change its background, so that it can comply with the overall UI design, change the background is very simple to prepare a picture and then specify the attribute android:background= "@ drawable/bg", but do not be happy too early, when you do so, found that the background has changed, but when you drag, or click on the list blank space when you find that ListItem has become black, destroying the overall effect.

If you just change the background color, you can directly specify android:cacheColorHint as the color you want. If you are using a picture as the background, just specify android:cacheColorHint as transparent (# 00000000).

Fourth

Divider property, which is used to set a picture as an interval between each item, or to remove the dividing line between item

Android:divider= "@ drawable/list_driver" where @ drawable/list_driver is an image resource. If you do not want to display the split line, just set it to android:divider= "@ drawable/@null".

Fifth

FadingEdge property with black shadows above and below

There is no shadow after android:fadingEdge= "none" setting.

Sixth

The scrollbars property, which hides the scroll bar of listView

The effect of android:scrollbars= "none" is the same as that of setVerticalScrollBarEnabled (true);, hiding when inactive and hiding when active

Seventh

FadeScrollbars property, android:fadeScrollbars= "true" when configuring the ListView layout, setting this property to true can automatically hide and display the scroll bar.

On the more special attributes of Android ListView which are shared here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report