我爲我的應用程序創建了微調器。這是在main.xml中如何將事件與微調選項相關聯
<Spinner
android:id="@+id/sMenu"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:prompt="@string/base"
/>
,並在我的主類
String [] base = {"Decimale", "Binaria", "Ottale", "Esadecimale"};
Spinner s1;
s1 = (Spinner) findViewById (R.id.sMenu);
ArrayAdapter adapter = ArrayAdapter.createFromResource(this, R.array.base, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
s1.setAdapter(adapter);
程序轉換爲二進制,十進制,八進制,十六進制的數的代碼。我想把一些事件聯繫到微調。例如,如果我在微調二進制文件中選擇,在編輯文本中,我只能輸入二進制數字。我能以哪種方式將此事件與微調器相關聯?
你試過了什麼?在粘貼代碼之前,您是否嘗試過尋找解決方案? –