2017-03-14 7 views
0

私はこのように行うことができますどのようにこの画像で enter image description hereAlertDialog内のビューをカスタマイズするにはどうすればいいですか?

ようAlertDialog単一選択に私のビューをカスタマイズしたいですか?あなたはより多くのカスタマイズオプション

alertDialogue.setContentView(/*Layout*/) 

かあなたには、いくつかの選択肢がこれを使用したい場合が欲しい場合

答えて

1

はこれを使用しています。あなたが私にそれを行うための正しい方法を表示することができるように

alertDialogue.setMultiChoiceItems(R.array.toppings, null, 
         new DialogInterface.OnMultiChoiceClickListener() { 
       @Override 
       public void onClick(DialogInterface dialog, int which, 
         boolean isChecked) { 
        if (isChecked) { 
         // If the user checked the item, add it to the selected items 
         mSelectedItems.add(which); 
        } else if (mSelectedItems.contains(which)) { 
         // Else, if the item is already in the array, remove it 
         mSelectedItems.remove(Integer.valueOf(which)); 
        } 
       } 
      }) 

チェック迅速な返信用android guide

+0

おかげで、私は、実際にはonSingleChoiceItems使用する必要がありますか? –

+0

1つの値を持つ配列を使用 –

+0

これを試してみましょう –

関連する問題