last day (14 days later) » 

10:22 AM
0
Q: ellipsize="marquee" doesn't work in spinner

Misagh EmamverdiI am using a simple spinner: final SimpleCursorAdapter statusAdapter = new SimpleCursorAdapter(this, android.R.layout.simple_spinner_item, null, new String[] { "_id" }, new int[] { android.R.id.text1 }, 0); statusAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);...

 
why dont u use custom spinner item?
 
@d.i.v.a you mean that I should create a custom layout instead of using android.R? So what's the difference if I create a custom layout with a TextView containing ellipsize attribute?
 
becoz i m not 100% sure that android.R.layout...will contain ellipsize...
 
It contains, I checked it.
 
can u provide me link ?
 
10:22 AM
I have no link. In eclipse IDE I can see source of android.R.layout files by holding ctrl and clicking on their name.
 
ok let me chk AOSP
 
thats true that android:ellipsize="marquee" is presenet in android layout here grepcode.com/file/repository.grepcode.com/java/ext/…
but the thing is android:scrollHorizontally="true" should also be present to make this work
hence you need custom layout
@MisaghEmamverdi
@MisaghEmamverdi did you got the point which i made?
 
I am going to test it
 
ok
TRY WITH BELOW ATRITBUTES

android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:freezesText="true"
@MisaghEmamverdi
if you miss any of above may be that will not work
 
10:37 AM
Thanks but they didn't help. Text doesn't move yet. Also If I use android:focusableInTouchMode="true"
android:freezesText="true"
Spinner doesn't respond to click on items
 
ok let me try at my end
 
OK thanks
 
10:48 AM
@MisaghEmamverdi hey is working for me
 
could you pleas post your code?
 
yes posting complete source code
@MisaghEmamverdi posted as answer
 
Thanks I am checking it
 

last day (14 days later) »