2
私はスピナーを持っています。スピナーを選択クラスとしてプロンプトしたいです。アンドロイドの編集テキストのためのアンドロイド:ヒントプロパティがあります。私はダイアログボックスでスピナーを望んでいません。セレクションがドロップダウンされる前に、スピナーの指示やヒントを欲しい。出来ますか?? 助けてください!!!! ありがとうドロップダウン機能付きスピナーのプロンプト
私は以下のコードが、くぼみの作業を試してみました
classname[0] = "SELECT CLASS";
for (int i = 1; i < classdetails.size() + 1; i++) {
classname[i] = classdetails.get(i - 1).getClass_name() + " "
+ classdetails.get(i - 1).getSection_name().toString();
}
ArrayAdapter<CharSequence> adapterClasses = new ArrayAdapter<CharSequence>(
getApplicationContext(), R.layout.spinner_item_class,
R.id.spinnerclasstxt, classname);
spnrClass.setAdapter(adapterClasses);
spnrClass.setSelection(0);
spnrClass
.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1,
int pos, long arg3) {
int selectedindex = pos;
if (selectedindex == 0) {
spnrSubject.setVisibility(View.INVISIBLE);
} else {
spnrSubject.setVisibility(View.VISIBLE);
selectedClass = classdetails.get(selectedindex - 1);
subjectpopulate(selectedClass);
}
}
@Override
public void onNothingSelected(AdapterView<?> arg0) {
}
});
これはダイアログタイプのスピナーでは機能しますが、ドロップダウンタイプでは機能しません –