Setting text style for a Spinner?

by Mark Wyszomierski » Wed, 31 Mar 2010 02:44:52 GMT


Sponsored Links
 Hi,

I have a Spinner in a resource file. I'm giving it an
ArrayAdapter<String> to show.

What's the right way to style the font used by the spinner? I'd like
to change the size of the text and its color. I tried:

  <Spinner
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:textAppearance="@style/mystyle" />

but it's not being honored,

Thanks

--



Setting text style for a Spinner?

by Mark Murphy » Wed, 31 Mar 2010 02:48:55 GMT


 


Set the font used by the Views served by the Adapter you associate with
the Spinner. A Spinner by itself has no text.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Android 2.x Programming Books:  http://commonsware.com/books 

--


Sponsored Links


Other Threads

1. data upload java script

I need a javascript snippet to upload some data to a server, any
sample code ? basically what i need is a page loads and the java
script loads as part of thet page. that page also puts some data in
hidden value. (or suggest better alternative). now, as soon as the
page loads completely, the javascript uploads the data in hidden
variable to another web server.

please give me some pointers and code snippets. i need it to run in
android browser

-- 

2. InputMethodManager and it's active View

I would like to know if there is any way to determine and set what
view is active to the InputMethodManger. I have a scenario where
attempting to show the soft keyboard is always returning false. Asking
for imm.isActive() returns true so some view is active... but I have
not been able to determine which it is.

The scenario I have is an AlertDialog containing a single EditText
view. In my main activity, I click a button that launches the Dialog.
I have an onFocusChangeListenter set on the EditText which checks when
it receives focus and based on log messages it is receiving focus
successfully when the dialog is displayed. However, I am running
several checks inside if(hasFocus) and the all return false. Here are
some of the tests I'm running during onFocusChange(View v, boolean
hasFocus).

imm is the InputMethodManager called with the usual convention of
(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE).

((EditText)v).isInputMethodTarget() returns false
imm.isActive(v) returns false
imm.isActive() returns true, so some view is active for input...
imm.showSoftInput(v, 0) does not show the view and returns false.
imm.showSoftInput(mAlertDialog.getListView(), 0) also returns false,
thinking possibly the ListView for the dialog was the view which was
active, though it is not.

I'm hoping someone might be able to steer me in the right direction. I
HAVE been able to show the keyboard by getting the Window, then
IBinder WindowToken and passing that to setSoftInputMode, but then it
behaves erratically afterward.

Thanks everyone,
Jeremiah

-- 

3. viewgroup and view

4. Android Revolution HD 2.0.9

5. Android saceng is back, with gps

6. Oot : adakah androiders dari solo ?

7. [WTA for help] Motorola Milestone sering 'no sim card'