The spinner is equivalent to the drop-down list box in HTML. In the following example, we will learn how to use the spinner.
Attribute:
Attribute name
Description
Android: Prompt
This prompt is displayed in the drop-down list dialog box. (Translator's note: The title of the dialog box:
Method:
Public charsequence getprompt ()
Return Value
Prompt displayed when the dialog box
In the previous article, we introduced how to obtain data from provinces, cities, and cities. Now we will introduce an example of how to use the spinner control to implement Level 3 linkage between provinces, cities, and cities.
The following code is implemented during project development.
First, we will show the three slaves in the layout file.
Android: layout_width = "fill_parent"Android: Id = "@ + ID/linearlayoutarea" Android: Orientation = "horizo
Use of the Android:spinner (drop-down box) controlCreate a paging file (Main.xml)1 2 android:id= "@+id/spinner1"3 android:layout_width= "Match_parent"4 android:layout_height= "Wrap_content"/>56 7 android:id= "@+id/tvresult"8 android:layout_width= "Match_parent"9 android:layout_height= "Wrap_content"Ten android:text= "Fruit of choice"/>Create a data source for a drop-down box1 list2 List.add ("Apple");5 List.add ("banana");7 List.add ("Orange");9 List.add ("banana");Create adapter (the data sourc
I. Spinner (drop-down list ):
Encoding implementation: first define the Spinner component in the layout file, connect the optional content through ArrayApadter and the drop-down list, and finally obtain the user selection option, you need to design the event listening setOnItemSelectedListener and implement onItemSelected to obtain the content selected by the user.
The ArrayAdapter adapter is used to connec
Example
The spinner is the drop-down menu, which is equivalent to the swing combo box and HTML
AndroidProvided SpinnerThe drop-down menu of widgets is very easy to use and the style is also applicable. However, the focus of this example is to customize the style in the drop-down menu. The key is to callThe setdropdownviewresource method defines the display style of the drop-down menu in XML format. In addition to the custom drop-down menu, this examp
Android drop-down box, and android drop-down box
What is a spinner? A drop-down menu is actually a pop-up window, but it can be further operated. Click the triangle symbol to bring up a window, usually a list, and then perform operations.
Its definition in the xml file is no different from that in other controls,
1
However, in addition, there are other steps for the definition of the spinner, in the strin
In the previous article to introduce the Android QQ login interface encountered problems and solutions, this article continues to introduce you to the Android QQ interface knowledge.
First to show you the effect of the picture:
Problem:
1. Drop down list (because you haven't seen this yet ...) )
2, the title bar display problems
3, the button to Enable settings
Here's the code:
Layout Fragment_main (Issue 1)
Background before and after EditText,
Scenario
How can we achieve "ajaxstart" in a specific request?
First, the price for rewriting Ajax methods is too high, and jquery's own Ajax events can still be used.
Global events triggered by Ajax are transmitted to all DOM nodes like a standard event. Level: jquery events> Ajax events> Custom Ajax events.Implementation
Wo = Window. wo | {}; wo. ajax = {spinner: $ ([]), init: function () {var $ spinner =
ACCESS_FINE_LOCATION permission .Second, Spinner's SetSelection () method, originates from oneself to take for granted pit!!!The drop-down list control in Android spinner has a method setselection (int position) that shows the first few items. This method may not be effective??? Always show the first item???------------------------------------Split Line----------------------------------When doing two spinner
Show Effect:
1 when the load is clicked, the simulation performs an asynchronous load. Browsers are blocked. The progress bar appears.
Realize the idea:
1. When the user clicks on the Load button to execute the asynchronous request. Call method Occurrence Add-in Bar
2. How to achieve the progress bar?
1 Add a div in document.body. Overwrite browser. Setting the background will be gray. Z-index = 999. Allows users to not modify boundary value when loading
2 Add a dynamic div to the docume
Scene
How do I achieve the "ajaxstart" effect on a particular request?
First, rewriting Ajax methods is too expensive to take advantage of JQuery's own Ajax Events.
Global events triggered by Ajax are propagated to all DOM nodes like a standard event. Levels: JQuery Events > Ajax Event > Custom Ajax incidents.
Realize
Copy Code code as follows:
Wo = window. Wo | | {};
Wo.ajax = {
Spinner: $ ([])
, Init:function () {
var $
I haven't written a blog for a long time. Today I want to share with you a small function that is very practical.
Use Case: Disable all the child controls in the layout so that the interface can only be viewed but not edited. It is very troublesome to set one control, so I thought of a good method. You can expand more controls as needed, as long as you pay attention to the ViewGroup type or View type of the control.
The Code is as follows:
[Java]/*** Traverse the layout and disable all child
Features:1. No image, no external CSS2. No dependency (jQuery supported, but not required)3. configurable height4. Resolution independence5. VML is supported when the earlier version of IE is not supported.6. Use the Key Frame Animation and setTimeout ()7. compatible with various mainstream browsers, including IE68. MIT Authentication
Spin. js dynamically creates a progress bar, which can be replaced by loading GIF images using ajax.
The spin () method initializes the necessary HTML elements a
Scenario
How can we achieve "ajaxStart" in a specific request?
First, the price for rewriting Ajax methods is too high, and jQuery's own Ajax Events can still be used.
Global events triggered by Ajax are transmitted to all DOM nodes like a standard event. Level: jQuery Events> Ajax Events> Custom Ajax Events.
Implementation
Copy codeThe Code is as follows: Wo = window. Wo || {};
Wo. ajax = {
Spinner: $ ([])
, Init: function (){
Var $
First look at the effect chart:
Problem:
1. Drop down list (because you haven't seen this yet ...) )
2, the title bar display problems
3, the button to Enable settings
..........
Here's the code:
Layout Fragment_main (Issue 1)
Background before and after EditText, Spinner and Button modifications 1.bg_edittext
2.bg_spinner
3.bg_button
4.bg_buttin_change
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.