Android : Changing the text size of the spinner

on Sunday, October 5, 2014


I am the beginner in android programming.


I am trying to change the text size of the spinner as mentioned in some question here. I have created my_spinner_style.xml in res/values/ like below.



<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/spinnerTarget"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textSize="13sp"
/>


and used adapter like this



spinner = (Spinner)findViewById(R.id.spinner);
ArrayAdapter<CharSequence> adapter=ArrayAdapter.createFromResource(this,R.array.answers,android.R.layout.my_spinner_style);
spinner.setAdapter(adapter);
spinner.setOnItemSelectedListener(this);


and also tried creating style.xml in layout folder. My adapter does not recognize "my_spinner_style" . Have I placed it in wrong directory ?


0 comments:

Post a Comment