spinner

Android 2.2 - how do i set an spinner's alpha property?

大憨熊 提交于 2019-12-06 11:10:27
I'm trying to make a spinner totally transparent. In Android 4.0 I can do this setting the alpha property to 0 in the xml layout designer. But when I work with Android 2.2 i can't use that property, Eclipse mark it as an error and tell me that i can't use it. I tried to make it transparent writting this java code: final Spinner cmbCategorias = (Spinner) findViewById(R.id.cmbCategorias); cmbCategorias.getBackground().setAlpha(0); and it works, but the text in the spinner keeps visible. Someone can tell me what can i do?? Thanks Make xml Layout like spinner_textview.xml <?xml version="1.0"

Spinner showing items as Drop Down List

試著忘記壹切 提交于 2019-12-06 09:43:00
I have made a spinner in an activity getting called inside a tab layout. The problem is that the items (3 in nos.) are being showing in a separate dialog as in case of a drop down list and not as a spinner. I followed this example. And as shown the picture I was expecting but I am getting this: & this . I want to show just 3 items inside the spinner and do not want the new dialog for the items to be selected. And I have tried my code both on 2.3.3 and 4.0.3 emulators. Any suggestions? Thanks spinner as a dropdown is of HOLO Theme. first image is of HOLO Theme and 2nd and 3rd is not.. holo

How to set “hint text” for spinner? [duplicate]

三世轮回 提交于 2019-12-06 09:37:00
问题 This question already has answers here : How to make an Android Spinner with initial text “Select One”? (37 answers) Closed 3 years ago . The value of the Spinner from Database. I am confusing to add hint for Spinner, I followed some posts in SO but i am struck with this place and I Tried this Spinner sp = (Spinner)findViewById(R.id.spinner); sp.setSelection(pos); the position have Integer value so i give it as a Integer value for position,also i try with getCount() inside of setSeletction()

Getting an enumerated value out of an Android Spinner

白昼怎懂夜的黑 提交于 2019-12-06 09:32:21
I've written the class below to let me get an enumerated value out of an Android Spinner. There are two lines in getValue() neither of which compile. How should I do this? public class EnumSpinnerListener<T extends Enum> implements AdapterView.OnItemSelectedListener { private String mValue = null; public EnumSpinnerListener(AdapterView<?> adapterView) { adapterView.setOnItemSelectedListener(this); } @Override public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { mValue = adapterView.getItemAtPosition(i).toString(); } @Override public void onNothingSelected

jquery ui spinner for minutes

爷,独闯天下 提交于 2019-12-06 08:41:21
问题 Im trying to use the jquery ui spinner for a minutes input. Currently it works 0 - 60 but I want the single digits to be 00,01..09 double digits. According to the docs I should use globalize plugin and set numberFormat: 'mm' but that threw an error. In the console I looked at globalize js and 'mm' option is inside 'formatDate'. So I tried: $('.minute-spinner').spinner({culture: "en-US",formatDate: "mm"}); but that didn't do anything. Anyone know how to make a spinner always show 2 digits? 回答1

Spinner with custom text font and color

ⅰ亾dé卋堺 提交于 2019-12-06 07:37:50
I want to use custom font and color in Spinner. I can't modify them directly in <spinner/> Here's my code <Spinner android:id="@+id/spinner2" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="5pt" android:layout_marginTop="5pt" android:backgroundTint="#d9d9d9" android:entries="@array/dropdown_main" /> It should look like this: Text font is Product Sans Bold, color is #333333 Here you can make a custom xml file in layout folder where you can add this: <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk

Select Item in Spinner - Android

杀马特。学长 韩版系。学妹 提交于 2019-12-06 07:28:30
I have an item with id and value and I want to add them into a spinner. So when I select the item, I will get the id of it. I can only add itemValue as below and get the selected String. Can anyone give me the solution for this? List<String> list = new ArrayList<String>(); list.add("item 1"); list.add("item 2"); list.add("item 3"); ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>( this, android.R.layout.simple_spinner_item, list); dataAdapter .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); final Spinner sp = new Spinner(this); sp.setAdapter(dataAdapter);

How to add spinner/loader in yii2 php

你离开我真会死。 提交于 2019-12-06 07:16:45
问题 I want to add a spinner/loader in one of my forms. The scenario is simple: When I hit the create button then it will show a spinner/loader. On hitting the create button a call to a web-service is made so the spinner/loader will show from call start to call end. Below is my controller: $m = MetersInventoryStore::findOne($_REQUEST['selected_meters']); $msn = $m->meter_serial; // current selected meter serial number is saved $date_time = str_replace(' ', 'T', date('Y-m-d H:i:s')); // current

populate city spinner after state spinner has been selected

送分小仙女□ 提交于 2019-12-06 06:25:50
问题 This is my question: How do I have two spinners "State" and "City" but the city will be empty until the user selects a state first. I am building my spinners dynamically using json data and you will see in my code below that once the state spinner value is != 0 then I use the item value of the state spinner and do another database call for my cities. My only error is showing when I create my new ArrayAdapter to hold to the city data. I hate to post all of my code for my activity but not sure

How can I get the position of a row in a dataset in order to set the selected item in an Android Spinner?

坚强是说给别人听的谎言 提交于 2019-12-06 06:25:48
I have a Spinner that's populated using a cursor containing data from a database. It appears that it's impossible to set the selected item in the spinner using the value of the ID column of a row. And that the only way to set the selected item is by using the position of the row within the dataset. Is this correct? If so, is there a more efficient way of determining the row's position than by iterating through the dataset using the cursor? The inefficient (to my mind) way is outlined here . Thanks much! First step, create view for your data set, with joins etc.: CREATE VIEW my_view AS SELECT