我制作了一个数字选择器对话框。它看起来像左边的图像,但没有上/下箭头:
我怎样才能添加它们?
这是我的代码:
public class NumberPickerFragment extends DialogFragment
implements DialogInterface.OnClickListener {
protected final String CLS = this.getClass().getSimpleName();
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
// TODO: Make this more flexible
NumberPicker np = new NumberPicker(getActivity());
np.setMaxValue(250);
np.setMinValue(100);
np.setValue(150);
np.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS);
np.setWrapSelectorWheel(false);
return new AlertDialog.Builder(getActivity())
.setTitle(R.string.height)
.setView(np)
.setPositiveButton(android.R.string.ok, this)
.create();
}
@Override
public void onClick(DialogInterface dialog, int whichButton) {
// TODO: Do something with the return value
Log.d(CLS, "Received click");
}
}