我想全屏显示微调框。.我到达了我没有得到适当解决方案的地方。
XML
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/spinner_style"
android:layout_below="@+id/appbarlayouts"
android:overlapAnchor="false"
android:id="@+id/task_spinner"></Spinner>
Java
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_dropdown_item, categories) {
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent)
{
View v = null;
v = super.getDropDownView(position, null, parent);
// If this is the selected item position
if (position == selectedItem) {
v.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDark));
}
else {
// for other views
v.setBackgroundColor(Color.WHITE);
// ((TextView) parent.getChildAt(position)).setTextColor(Color.BLACK);
}
return v;
}
}; // Drop down layout style - list view with radio button
dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
task_spinner.setAdapter(dataAdapter);
我的输出 我想显示下拉至底部视图,但目前未显示