我使用的微調,和的EditText中的按鈕一個PAGE電泳微調有這些項目的微調項特定項目後...EDITTEXT想去從禁用啓用選擇
以下:
String[] Items = {
"Alarm",
"Office",
"Meeting",
"Party",
"Lunch",
"Breakfast",
"Supper",
"Home",
"Private",
"Outdoor",
"Family",
"Friends",
"others"
};
Spinner s1;
在,如果我在轉項中選擇「其他」是指只有EDITTEXT必須另行啓用它必須是disabled.If我選擇一些其他項目EDITTEXT已被禁用
代碼片段:
s1 = (Spinner) findViewById(R.id.spinner);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, Items);
s1.setAdapter(adapter);
s1.setOnItemSelectedListener(new OnItemSelectedListener()
{
public void onItemSelected(AdapterView<?> arg0,
View arg1, int arg2, long arg3)
{
int index = s1.getSelectedItemPosition();
Toast.makeText(getBaseContext(),
"You have selected item : " + Items[index],
Toast.LENGTH_SHORT).show();
}
public void onNothingSelected(AdapterView<?> arg0) {}
});
謝謝,
您的問題沒有適當解釋閱讀你的描述,並進行更改 – ingsaurabh 2011-02-09 11:30:07