android-spinner

Android Spinner: Remove Extra White Space Between Text and Dropdown Icon

旧城冷巷雨未停 提交于 2019-12-19 07:41:46
问题 I have a spinner and by default there is extra white-space between text and dropdown icon which I really don't like and wanna remove it. Tried searching over the web but did not get anything which could help me. Anybody here who has done it earlier? 回答1: I did it myself after playing with Spinner. Here is the solution which worked pretty well. First create a Dropdown with indicator image of your choice. <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape

How can I add my spinner to the ActionBar?

别等时光非礼了梦想. 提交于 2019-12-19 05:23:29
问题 I'm trying to get my spinner working as the Action Bar Drop Down List item, but I cant seem to implement it at all, there aren't many tutorials for this after searching through Google. I think its something to do with the .setListNavigationCallbacks(); line of code, I just have no idea how to get this working from that line onwards. // setup action bar for spinner ActionBar bar = getActionBar(); bar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); bar.setListNavigationCallbacks(); Spinner

Spinner Theme is dark in Android

孤者浪人 提交于 2019-12-19 00:43:14
问题 I am trying to change the toolbar spinner dropdown theme strangely this is not happening. It is coming up always dark when I click on the spinner. I would like to have the background grey and text black. I don't have any actionbar. I am setting everything through toolbar. Hence I tried the following: <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res-auto" android

Android: Need to change the spinner background color

梦想的初衷 提交于 2019-12-18 17:14:15
问题 I'm using three spinners inside of my XML file. Want to change spinner color until press the next spinner. This is my xml I used: <Spinner android:id="@+id/spinner13" android:drawSelectorOnTop="true" android:background="@drawable/mybg" android:layout_width="80dp" android:layout_height="wrap_content" android:textColor="#0000FF" /> <Spinner android:id="@+id/spinner23" android:drawSelectorOnTop="true" android:background="@drawable/mybg" android:layout_width="80dp" android:layout_height="wrap

Spinner inner padding is larger on Android 6.0.1

前提是你 提交于 2019-12-18 12:57:09
问题 Intro: With the new release of Android 6.0.1, seems like Android made some changes on the Spinner component because by default, the inner padding around the down carrot is a bit bigger. I noticed this on an app where I haven't modified anything in the code, but simply updated the OS on the device and yet the spinners have different sizes. Situation: I have 2 spinners one next to the other in a RelativeLayout (mind the rest of the components, I added everything so you can see this part of the

How to change a spinner's list background color in Android

被刻印的时光 ゝ 提交于 2019-12-18 12:15:51
问题 I'm creating a new spinner dynamically, how can I change my list background color? the current background color is some dark gray: When I'm changing the spinner's background attribute to white, i'm getting this unwanted situation: I want it to be transparent in the activity, and only when i'm opening the spinner (press on it), I want the background will be white. Here is the code that I'm creating the spinner with: I'm creating the adapter with: mAdapter = new ArrayAdapter<String>

Create a spinner programmatically android

北战南征 提交于 2019-12-18 12:14:14
问题 I want to create a spinner without using xml. I am new in android and my knowledge is limited. By now i have this code (see above) and i want my spinner in on of the tabs of my TabActivity. There is no obvious error but whene i open my activity the tab is empty. I would appreciate some help. public class Search extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ArrayList<String> spinnerArray = new ArrayList<String>(); spinnerArray.add("one

How can I style android spinner prompt

前提是你 提交于 2019-12-18 06:56:31
问题 I have developed one example. Here I have to style a spinner prompt. Please help me. How can I style it? This is my string.xml code: <?xml version="1.0" encoding="utf-8"?> <resources> <string name="hello">Hello World, CustomizedListView!</string> <string name="app_name">CustomizedListView</string> <string name="status_prompt">Choose a Status</string> </resources> This code is used on my main.xml: <Spinner android:id="@+id/spinner1" android:layout_width="wrap_content" android:layout_height=

Unable to check/uncheck CheckedTextView inside getView

橙三吉。 提交于 2019-12-18 03:09:11
问题 I'm loading phone contacts in a custom ListView. Each row is a checkable LinearLayout containing a CheckedTextView and another TextView. I'm feeding the list view with a custom ArrayAdapter. My problem is that I can't control CheckedTextViews inside getView(). For example when I try the following public View getView(int position, View convertView, ViewGroup parent) { View row = convertView; if(row == null){ row = inflater.inflate(layout, parent, false); } CheckedTextView checkedTextView =

Correct usage of a Spinner, following material design guidelines

丶灬走出姿态 提交于 2019-12-17 23:15:38
问题 After reading the new design guidelines of Google's material design, I didn't found any clear solution for designing/displaying a spinner (http://developer.android.com/design/building-blocks/spinners.html) in material design. The nearest would be something like this: http://material-design.storage.googleapis.com/publish/v_1/quantumexternal/0Bx4BSt6jniD7anplVHR3QkdNUHc/components_menus_behavior2.png - but I'm quite sure, there will be some better solution. Especially if it comes to spinner