spinner

kivy spinner widget with multiple selection

北战南征 提交于 2019-12-09 21:47:28
问题 I am looking for a kivy widget (preferrably in python + kv file) of type spinner (or something alike) where I can select multiple items through a checkbox for example. The selected items should become available in a tuple (?). In the picture start.png you will find the starting situation. In a form there is a label and a Textinput field. On click a list with available options should popup. For this I am using a Spinner widget. See picture select.png From this list I want to select multiple

Align spinner values to right instead of left

回眸只為那壹抹淺笑 提交于 2019-12-09 08:18:40
问题 In spinner xml, I'm using: android:entries="@array/cars" where cars is list of numeric items. The spinner automatically align values to left, and I can't find in xml/code how to change it. 回答1: You have to use a custom view here to give alignment to the Spinner values. Create a CustomView like this answer has created and add android:gravity to the TextView as right . UPDATE: Set the CustomView to your adapter using adapter.setDropDownViewResource(android.R.layout.your_custom_created_view);

How to customise the TextView inside a Spinner?

有些话、适合烂在心里 提交于 2019-12-09 06:12:46
问题 I have a Spinner with an ArrayAdapter that feeds Values into it. The layout for this views looks something like this: <TextView android:text="Household Income: " android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center_vertical" /> <Spinner android:id="@+id/incomespinner" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="2dip" /> The Problem is that the text is to long for the view and the result is a very very ugly

Spinner cannot load an integer array?

跟風遠走 提交于 2019-12-09 02:38:34
问题 I have an application, which has a Spinner that I want populated with some numbers (4,8,12,16). I created an integer-array object in strings.xml with the items mentioned above, set the entries of the Spinner to the integer-array, and when I run the app I get: 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): java.lang.NullPointerException 04-19 23:38:48.016: ERROR/AndroidRuntime(10193): at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:355) 04-19 23:38:48.016: ERROR

How to set the value and text in a Spinner from a string list?

偶尔善良 提交于 2019-12-08 15:04:54
问题 i am working on android spinner control. i already have populate list of string to show in spinner like String[] items = new String[]{ "Office", "Home", "College", "Uncle's Home", "CoDebuggers"}; ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_dropdown_item, items); SpinnerName.setAdapter(adapter); this is working well but i need to add unique id for my list like Office = 4 Home = 8 College = 9 Uncle's Home = 10 CoDebiggers = 55 how can i set

how can I get selected value in spinner such as C# ComboBox?

点点圈 提交于 2019-12-08 14:32:20
I trying to make a custom Spinner containing Id and Title. This Spinner displays Title but everywhere in my code I can access to selected Id. how can I do it. it's like ComboBox in C#. thanks. if you have id's and names in the separate arrays then based on the spinner selected item position you can get selected item id. spinner.setOnItemSelectedListener(new OnItemSelectedListener() { public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) { System.out.println(Id_arr[spinner.getSelectedItemPosition()]);// for spinner id System.out.println(spinner.getSelectedItem()

Android Dynamic Spinner Update

…衆ロ難τιáo~ 提交于 2019-12-08 13:42:52
问题 I'm working with Android and Spinners and I need some help. I have a class that creates two spinners and a button. The first spinner is for my category, my second is for my sub-category. What I am trying to do is dynamically update the second spinner (spinner2). I've been trying to use adapter2.clear() but that crashes android, with an error "unable to start activity componentinfo unsupported operation" Here is my code: public class MyClass extends MyBaseClass { int category; int sub_category

Disappearing dividers in Spinner drop-down list

99封情书 提交于 2019-12-08 13:31:07
问题 I am writing my first simple Android App: It loads temperature samples from a Java based measurement system (CSV via HTTP), shows the available channels in a Spinner and when a channel is selected, it shows the corresponding value and a timestamp in two TextViews. The App works fine, except a little cosmetic problem: The items in the drop-down list are separated by a horizontal line (divider) and depending on the scroll position, some lines disappear and appear again, when I scroll some more

Android array cannot be resolved or is not a field

给你一囗甜甜゛ 提交于 2019-12-08 12:45:23
问题 I have the following code segments in my program: ArrayAdapter<CharSequence> dataAdapter = ArrayAdapter.createFromResource( this, R.array.datatypes, android.R.layout.simple_spinner_item); ArrayAdapter<CharSequence> timeAdapter = ArrayAdapter.createFromResource( this, R.array.timetypes, android.R.layout.simple_spinner_item); I am getting an error on "R.array" indicating that array cannot be resolved or is not a field. This was working moments ago and I am unsure what I have this. I have tried

Android spinner with black text on a dark background

不想你离开。 提交于 2019-12-08 11:56:20
问题 For an Android activity with theme: <android:theme="@android:style/Theme.Light.NoTitleBar"> and no other explicit colour properties, on a Motorola DroidX (Android version 2.3.340.MB810.Verizon.en.US), the spinner and button backgrounds are dark with black text although the main background is white. On most other phones, spinner and buttons appear as black text on a light grey gradient background. Am I doing something wrong, or might this be an Android or Motorola bug? In any case, can anyone