Android: Control Autocompletetextview Auto Prompt
Enter the information we want to enter in the input box and there will be other hints associated with it, which is implemented in Android using Autocompletetextview.
Xml
< Autocompletetextview Android:layout_width = "Match_parent" android:layout_height= "Wrap_content" android:id= "@+id/autotext" />
Java
Public classMainactivityextendsActivity {PrivateAutocompletetextview AutoText;PrivateArrayadapter<string>Arrayadapter; @Overrideprotected voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); Setcontentview (r.layout.test); AutoText=(Autocompletetextview) Findviewbyid (R.id.autotext); String [] Arr={"AA", "AaB", "AAC"}; Arrayadapter=NewArrayadapter<string> ( This, Android. R.layout.simple_list_item_1,arr); Autotext.setadapter (Arrayadapter); }}
Autocompletetextview Common Properties |
Android:completionhint |
Set the prompt title that appears in the drop-down menu |
Android:completionthreshold |
Set how many characters the user will enter at least to display a prompt |
Android:dropdownhorizontaloffset |
The drop-down menu is offset horizontally between the text boxes. The default is left-aligned with the text box |
Android:dropdownheight |
The height of the drop-down menu |
Android:dropdownwidth |
The width of the drop-down menu |
Android:singleline |
Single-line display |
Android:dropdownverticaloffset |
Vertical offset |
android--control Autocompletetextview Automatic prompting