这是我填充 Spinner 的代码。它看起来奇怪而丑陋。
@Override
protected void onPostExecute(final List<String> result) {
System.out.println("Result: " + result);
final SpinnerAdapter adapter = new ArrayAdapter<String>(SearchTopActivity.this, android.R.layout.simple_spinner_dropdown_item, new String[]{"test1", "test2"});
countrySpinner.setAdapter(adapter);
}
<Spinner
android:id="@+id/countrySpinner"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
如何像这样修复它