spinner

Issue with android spinners - Loading distinct values in spinners

自闭症网瘾萝莉.ら 提交于 2020-01-17 08:12:11
问题 I'm using two Spinners to show the items I'm getting from the json response. I have 2 problems right now. When u check my logcat u can see there are items repeating (Right side list, u can see so many pan). I want to have 1 item only once in my Spinner. I want to use something similar to distinct we use in sql databases. My second problem is, Select pan in the 1 spinner then 2nd spinner should contain items related to pan. (select pan in 1st spinner and 2nd should display only Pan large, pan

Issue with android spinners - Loading distinct values in spinners

一笑奈何 提交于 2020-01-17 08:11:55
问题 I'm using two Spinners to show the items I'm getting from the json response. I have 2 problems right now. When u check my logcat u can see there are items repeating (Right side list, u can see so many pan). I want to have 1 item only once in my Spinner. I want to use something similar to distinct we use in sql databases. My second problem is, Select pan in the 1 spinner then 2nd spinner should contain items related to pan. (select pan in 1st spinner and 2nd should display only Pan large, pan

Spinner not saving as Shared/Saved Preference

无人久伴 提交于 2020-01-17 06:28:09
问题 Using shared prefernences to save String but having difficulty saving my spinner. public class MainActivity extends Activity { Spinner spnExample; Button btnSave; ArrayAdapter<CharSequence> adapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button btnSave = (Button) findViewById(R.id.btnSave); SharedPreferences prefs; loadData(); spnExample = (Spinner) findViewById(R.id.spnExample); adapter =

Custom Spinner Background

自作多情 提交于 2020-01-17 04:16:07
问题 I try to create a Spinner for choosing a color. The color should display in the Spinner-header. Here is a screenshot: But as you can see, the color don't fill my 9-patch Spinner background (header). Here is the 9-patch background: But I don't understand why... I implemented a custom ArrayAdapter, here is the code: spinner = (Spinner) findViewById(R.id.spinner); ArrayAdapter<String> adapter = new MyArrayAdapter(this, R.layout.spinner_row, R.id.textView1, items); spinner.setAdapter(adapter);

TypeError :object of type 'GtkSpinner' does not have property 'num-steps'

巧了我就是萌 提交于 2020-01-16 19:27:27
问题 I am learning about Spinners in PyGtk. I executed this program : #!/usr/bin/env python import gtk class Spinner: def __init__(self): window=gtk.Window() window.set_default_size(200,200) vbox = gtk.VBox(False, 5) hbox = gtk.HBox(True, 5) self.spinner = gtk.Spinner() self.spinner.set_property("num-steps", 10) button_start = gtk.Button("Start") button_stop = gtk.Button("Stop") window.connect("destroy", lambda q : gtk.main_quit()) button_start.connect("clicked", self.start_animation) button_stop

Android: change color of spinner's popup scrollbar

喜欢而已 提交于 2020-01-16 04:14:25
问题 How can I change the color of the spinner's popup scrollbar? For some reason the color of the scrollbar is currently white on a white background, it is not visible. 回答1: add android:scrollbarThumbVertical="@drawable/yourdawable //in your spinner yourdrawable.xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="your color" android:endColor="your color" android:angle="45"/> <corners android:radius="6dp" /> <

Method for Spinner item click listener with SimpleCursorAdapter and ViewBinder

橙三吉。 提交于 2020-01-15 11:42:47
问题 I got a Spinner element which I populate with data from a Cursor using a SimpleCursorAdapter . Also I'm using setViewBinder for a custom row layout of the Spinner . Everything works out fine, the Spinner gets the data and the Spinner items use the custom layout. But clicking the items from the Spinner drop down view doesn't do anything . It doesn't set the selected item as selected and doesn't close the drop down view. I don't know what I have to do so the selected item from the list is

Method for Spinner item click listener with SimpleCursorAdapter and ViewBinder

孤街醉人 提交于 2020-01-15 11:42:30
问题 I got a Spinner element which I populate with data from a Cursor using a SimpleCursorAdapter . Also I'm using setViewBinder for a custom row layout of the Spinner . Everything works out fine, the Spinner gets the data and the Spinner items use the custom layout. But clicking the items from the Spinner drop down view doesn't do anything . It doesn't set the selected item as selected and doesn't close the drop down view. I don't know what I have to do so the selected item from the list is

selected item on spinner won't work (ANDROID)

房东的猫 提交于 2020-01-15 09:28:08
问题 My data comes from Firebase database. I successfully populated the busNum to the spinner . But my problem is whenever I got to select the busnum , nothing shows up on my spinner . Here are some of codes. List<String> busnum = new ArrayList<String>(); busRef = new Firebase(Config.FIREBASE_URL_BUSNUMBER); busRef.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { for (DataSnapshot postSnapshot : dataSnapshot.getChildren()) {

Android: Global style for all Spinners in my app

空扰寡人 提交于 2020-01-15 03:41:25
问题 I'm using Xamarin Android in Visual Studio 2017. I have a few existing Spinners which are created in xml layout which all work perfectly and are styled exactly how I want them to look. The code for these is typically: <Spinner android:spinnerMode="dialog" android:id="@+id/SpnProject" android:layout_width="fill_parent" android:layout_height="40dp" android:layout_marginBottom="8dp" android:paddingTop="8dp" android:paddingBottom="8dp" android:paddingStart="8dp" android:paddingEnd="8dp" android