水平方向に自動スクロールする長い文字列で満たされた Spinner を使用しようとしています。
そこで、独自のドロップダウン レイアウトを使用するカスタム アダプターを作成しました。
レイアウト:
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
style="?android:attr/spinnerDropDownItemStyle"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:ellipsize="marquee"
android:marqueeRepeatLimit="50"
android:singleLine="true" />
私のアダプターでは、getDropDownView メソッドを上書きします。
public View getDropDownView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
mInflater = LayoutInflater.from(this.getContext());
convertView = mInflater.inflate(R.layout.scrolling_list_item, null);
}
return super.getDropDownView(position, convertView, parent);
}
私の CheckedTextView が自動スクロールせずに静止しているのはなぜですか?