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......
Thanks! Helped me a lot!
ReplyDeletethis does not work
ReplyDeleteHassan what problem you are facing?
DeleteThis comment has been removed by the author.
ReplyDeleteI tested it on Android 7.1.2 and it did not work.
ReplyDeleteThank you it helped me..
ReplyDeletethanks for sharing this information
ReplyDeleteBlue Prism Training in Bangalore
Blue Prism Training in BTM
Machine Learning training in bangalore
data science with python training in Bangalore
Artificial Intelligence training in Bangalore
Artificial Intelligence training in BTM
THANK U VEEEEERY MUCH =D LOOOOOOOOOVE YOU
ReplyDeleteWoori Casino Login - Play on Mobile or Desktop
ReplyDeleteThe 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,
This tutorial was exactly what I needed to get Facebook deep linking working in my app. The part about generating an app access token and using it to create the App Link object was where I was stuck—Facebook's official docs can be overwhelming. Your cURL example made it click. I also ran into an issue where my intent filter wasn't triggering, but your manifest example helped me spot my mistake.
ReplyDeleteFor anyone just starting out, combining mobile development with automation and deployment skills can really boost your job prospects. To build a more well-rounded foundation, I recently started exploring DevOps Course for Freshers in Electronic City. Thanks again for this practical, beginner-friendly post.