I 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);
statuseSpinner.setAdapter(statusAdapter);
There is android:ellipsize="marquee"
attribute in both android.R.layout.simple_spinner_item
and android.R.layout.simple_spinner_dropdown_item
. But I don't see any marquee animation when text is long.
As I read in this link, I should call setSelected(true)
in textView. So I extend a custom adapeter and here is bindView
method:
@Override
public void bindView(View view, Context context, Cursor cursor) {
TextView textView = (TextView) view
.findViewById(android.R.id.text1);
textView.setText(cursor.getString(0));
textView.setSelected(true);
}
But It didn't solve the problem. So how can I have marquee with spinner?