4

ナンバーピッカーダイアログを作成しました。左の画像のように見えますが、上下の矢印はありません。

ここに画像の説明を入力

どうすれば追加できますか?

これが私のコードです:

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");
    }
}
4

1 に答える 1