CustomPicker Ok and Cancel buttons' color

后端 未结 3 1639
-上瘾入骨i
-上瘾入骨i 2021-01-23 16:16

I have this custompicker class in android project:

 public class CustomPickerRenderer : PickerRenderer
    {
        private Context context;
        private IEl         


        
3条回答
  •  时光取名叫无心
    2021-01-23 17:11

    Get the button object through the API of dialog and set the text color of the button. This method can be personalized. One point needs to be noted: it must be called after show

    in your custom renderer,below _dialog.Show();

    ....
    _dialog.Show();
    Button btnOk = _dialog.GetButton((int)DialogInterface.ButtonPositive);
    btnOk .SetTextColor(Color.Red);
    Button btnCancel= _dialog.GetButton((int)DialogInterface.ButtonNegative);
    btnCancel.SetTextColor(Color.Red);
    

提交回复
热议问题