Try popular Android Application by Feliz-Droid

Try popular Android Application by Feliz-Droid

Speaking Caller logo
Speaking Caller
   
Battery temperature logo
Battery Temperature
   
Dual Photo logo
Dual Photo
   
Ganesh Wallpapersl ogo
Lord Ganesh Wallpaper
   
Girly Pink Keyboard l ogo
Girly Pink Keyboard

Thursday, September 22, 2011

show multiline text inside spinner

Dear all.

To show multiline text inside the spinner follow few steps below and get working.

Step 1: Create a new Layout file name as textview.xml. and overwrite the code with below  one.


<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:text="@+id/TextView01"
    android:id="@+id/TextView01"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textSize="17sp"></TextView>

Step 2: After that save this file and open the code file (.java)  file where spinner is used. If 
you have used Array Adapter to fill spinner. Then just write below code instead of that.

      ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.plans,     R.layout.textview);
        spinnername.setAdapter(adapter);


In above code, R.array.plans is the string array which i have used to fill spinner. I you have to fill spinner from the database then just try below code.

adapter = new ArrayAdapter<String>(this,android.R.layout.textview,aLst);

adapter.setDropDownViewResource(R.layout.textview);
spinnername.setAdapter(adapter);  
 
Now you have done with. Enjoy it.
 
Thanks...... 


   

10 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. I tested it on Android 7.1.2 and it did not work.

    ReplyDelete
  3. THANK U VEEEEERY MUCH =D LOOOOOOOOOVE YOU

    ReplyDelete
  4. Forex Broker Canada Best Forex Brokers For Your Forex Trading And Fx. The Profanity Review And Forex Today Reviews The Forex Brokers And Provides The Best Fx Ratings And Reviews.

    ReplyDelete
  5. Woori Casino Login - Play on Mobile or Desktop
    The Woori Casino App will ventureberg.com/ be available at Woori Casino on a mobile หาเงินออนไลน์ or desktop basis. To play on our mobile https://febcasino.com/review/merit-casino/ or desktop, you can also play with your https://octcasino.com/ desktop browser,

    ReplyDelete