Use of the Android GridView

Source: Internet
Author: User

Some property settings:

1.android:numcolumns= "Auto_fit" the number of columns in the//gridview is set to Automatic

2.android:columnwidth= "90DP" //width of each column, which is the width of item

3.android:stretchmode= "ColumnWidth" //Zoom synchronized with column width size

4.android:verticalspacing= "10DP" margin between//two rows

5.android:horizontalspacing= "10DP" margin between//two columns

6.android:cachecolorhint= "#00000000" //Remove the default black background when dragging

7.android:listselector= "#00000000" //Remove yellow background When selected (to customize the pressed effect, set it to Transparent color, set your own selector)

8.android:scrollbars= "None" //Hide the GridView scroll bar

9.android:fadescrollbars= "true" //set to True to enable auto-hide and display of scroll bars

10.android:fastscrollenabled= "true" //gridview a fast scrolling button (at least 4 page scrolling is displayed)

11.android:fadingedge= "None" //gridview fading (Fade) edge color is empty, the default value is vertical. (Can be understood as the top and bottom edge of the hint color)

12.android:fadingedgelength= "10dip" //define the length of the fading (fade) edge

13.android:stackfrombottom= "true" //set to True, your list will appear at the bottom of your list

14.android:transcriptmode= "Alwaysscroll" //When you dynamically add data, the list will automatically scroll down the latest entries can automatically scroll to the viewable range (after discovering the settings, you can always pull down, there is no data on it, you can pull, strange phenomenon!) )

15.android:drawselectorontop= "false" //Click on a record and the color will be the background color after the record, the text of the content is visible (default is False)


ListView and GridView This kind of control can only use the selector to set the effect of the press, but when the hand is released, the effect will not remain, to maintain the position can be done in a press position, set the Onitemclick event to note the value of position, Notify the data refresh, in the GetView to determine whether you set the tag, is to set the selected effect, not all of the removal of the selected effect.




Use of the Android GridView

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.