XML attributes of the Android Spinner component (for future reference)

Source: Internet
Author: User

Java. lang. object | ___ android. view. view | ___ android. view. viewGroup | ___ android. widget. adapterView <T extends android. widget. adapter> | ___ android. widget. absSpinner | ___ android. widget. the Spinner class summary displays only the visual controls of a sub-View in the container at a time, and allows you to select within the specified range. The project in the Spinner comes from the Adapter associated with it. Description: android: dropDownHorizontalOffset setDropDownHorizontalOffset: When the drop-down mode is set to "dropdown", the offset of the drop-down project selection window in the horizontal direction relative to the Spinner window. It must be a floating point size value with a unit, for example, "14.5sp ". Valid units include: px (pixels), dp (density-independent pixels), sp (pixels scaled based on the size of the referenced font), in (INCHES) mm (mm ). This attribute can also reference a resource (Format: @ [package:] type: name) or a topic attribute containing this type of value (Format :? [Package] [type:] name ). This attribute corresponds to the resource symbol dropDownHorizontalOffset of the global attribute. Android: dropDownSelector is used to set the Display Effect of the List selector when spinnerMode = "dropdown. It can reference other resources in the format of "@ [+] [package]: type: name" or "? The format of [package:] [type:] name is used to apply the topic attribute, it can also be color values in the format of "# rgb", "# argb", "# rrggbb", and "aarrggbb. Its global attribute resource symbol is dropDownSelector. Android: dropDownVerticalOffset setDropDownVerticalOffset (int) spinnerMode = "dropdown", the offset of the vertical direction of the drop-down project selection window relative to the Spinner window. This attribute must be a floating point size value with units, for example, "14.5sp ". Valid units include: px (pixels), dp (density-independent pixels), sp (pixels scaled based on the size of the referenced font), in (INCHES) mm (mm ). You can also reference a resource (Format: @ [package:] type: name) or a topic attribute containing this type of value (Format :? [Package] [type:] name ). This attribute corresponds to the global attribute resource symbol dropDownVerticalOffset. Android: dropDownWidth setDropDownWidth (int) specifies the width of the drop-down box when the spinnerMode is "dropdown. This attribute can be a floating point size value with a unit, for example, 14.5sp. Valid units include: px (pixels), dp (density-independent pixels), sp (pixels scaled based on the size of the referenced font), in (INCHES) mm (mm ). You can also reference a resource (Format: @ [package:] type: name) or a topic attribute containing this type of value (Format :? [Package] [type:] name ). It can also be one of the following constants: fill_parent =-1. The width of the drop-down box should be set using the screen width. This constant is discarded from API Level 8 and replaced by the mach_parent constant. Mach_parent =-1. The width of the drop-down box should be set using the screen width. It is introduced in API Level 8. Wrap_content =-2. The width of the drop-down box should be consistent with its content. Its global resource symbol is dropDownWidth. Android: gravity setGravity (int) is used to set the alignment of the selected project. It must be one or a combination of the following constant values (separated by the '|' symbol ). Top = 0x30: place the selected object on the top of its container without changing its size. Bottom = 0x50: place the selected object at the bottom of its container without changing its size. Left = 0x03: place the selected object to the left of its container without changing its size. Right = 0x05: place the selected object to the right of its container without changing its size. Center_vertical = 0x10: place the selected object in the vertical center of its container without changing its size. Fill_vertical = 0x70: to fully fill its container, the system increases the vertical size of the selected object as needed. Center_horizontal = 0x01: place the selected object in the horizontal center of its container without changing its size. Fill_horizontal = 0x07: to fully fill its container, the system will increase the horizontal size of the selected object as needed. Center = 0x11: place the selected object in the vertical and horizontal center of its container without changing its size. Fill = 0x77: to fully fill the container, the system will add the horizontal and vertical sizes of the selected object as needed. Clip_vertical = 0x80: optional additional settings. You can set the upper and lower edges of sub-objects in the container to crop the border of the container. The cropping is based on the Vertical Alignment Method: The top alignment will crop the bottom edge, and the bottom alignment will crop the top edge, not both the top and bottom edges. Clip_horizontal = 0x08: optional additional settings. You can set the left and right edges of sub-objects in the container to crop the border of the container. The cropping is based on the Horizontal Alignment Method: The left alignment will crop the right edge, and the right alignment will crop the left edge, not both the left and right edges. Start = 0x00800003: place the object at the starting position of its container without changing its size. End = 0x00800005: place the object at the end of its container without changing its size. The corresponding global attribute resource symbol is gravity. Note: a Spinner object is a window object container. Setting Its gravity attribute only changes the alignment of the sub-window objects in the container, and does not change the alignment of the content in the sub-Windows. Android: popupBackground setPopupBackgroundResource (int) uses this attribute to set the background of the drop-down list when the spinner = "dropdown. You can use the "@ [+] [package:] type: name" format to reference another resource or use "? In the format of [package:] [type:] name, you can also use color values in the format of "# rgb", "# argb", "# rrggbb", and "# aarrggbb. The corresponding global attribute resource symbol is popupBackground android: prompt. This attribute is used to display the prompt when the Spinner dialog box is displayed. It must use the "@ [+] [package:] type: name" format to reference another resource, or use "? The format of [package:] [type:] name is used to apply the topic attribute. The corresponding global attribute resource symbol is prompt. Android: spinnerMode: sets the display mode of the Spinner. Must be one of the following constants: dialog = 0: the Spinner is displayed as a counterpart window. Dropdown = 1: the Spinner is displayed as an embedded drop-down list. The corresponding global attribute resource symbol is spinnerMode.

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.