Android颜色选择器对话框 - 更改主题

时间:2013-07-03 16:00:02

标签: android colors dialog picker

我正在使用API​​演示(SDK Android)中包含的ColorPicker对话框...当我在我的应用程序上使用它时,大小会改变,也会改变背景颜色...我怎样才能获得与API演示中的对话框相同,这里有两张图片:

这是我喜欢的 enter image description here

这就是我所得到的 enter image description here

1 个答案:

答案 0 :(得分:0)

这很简单,只需更改ColorPickerDialog的构造函数:

public ColorPickerDialog(Context context,
                         OnColorChangedListener listener,
                         int initialColor) {
     super(context,android.R.style.Theme_Holo_Light_Dialog_NoActionBar);//set you favorite theme
     //super(context); //This is the normal constructor


    mListener = listener;
    mInitialColor = initialColor;
}