android 修改自带DatePickerDialog的“设置”、“取消”
2012-11-01 14:38
411 查看
最近使用DatePickerDialog日期控件,由于需要显示英文,但其自带的是“设置” ”取消“, 解决方法如下
public class MyDatePickerDialog extends DatePickerDialog{
public MyDatePickerDialog(Context context, int theme,
OnDateSetListener callBack, int year, int monthOfYear,
int dayOfMonth) {
super(context, theme, callBack, year, monthOfYear, dayOfMonth);
// TODO Auto-generated constructor stub
}
public MyDatePickerDialog(Context context,
OnDateSetListener callBack,
int year,
int monthOfYear,
int dayOfMonth){
super(context, callBack, year, monthOfYear, dayOfMonth);
setButton("Set", this);
setButton2("Cancle", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
}
}
public class MyDatePickerDialog extends DatePickerDialog{
public MyDatePickerDialog(Context context, int theme,
OnDateSetListener callBack, int year, int monthOfYear,
int dayOfMonth) {
super(context, theme, callBack, year, monthOfYear, dayOfMonth);
// TODO Auto-generated constructor stub
}
public MyDatePickerDialog(Context context,
OnDateSetListener callBack,
int year,
int monthOfYear,
int dayOfMonth){
super(context, callBack, year, monthOfYear, dayOfMonth);
setButton("Set", this);
setButton2("Cancle", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
}
}
相关文章推荐
- Android:解决DatePickerDialog只有完成按钮、没有取消按钮的问题
- Android DatePickerDialog 设置选择时间的最大值
- android DatePickerDialog被取消后仍然会执行onDateSet方法的解决
- Android 中NumberPicker,DatePicker与DatePickerDialog中分割颜色的修改实例代码
- Android 日期选择器 DatePickerDialog 修改主题颜色
- Android DatePickerDialog 设置日期范围
- Android:解决DatePickerDialog只有完成按钮、没有取消按钮的问题
- Android:解决DatePickerDialog只有完成按钮、没有取消按钮的问题
- Android datepickerdialog/timepickerdialog取消操作
- android 修改DatePickerDialog只显示“年月”,去掉“日”显示
- [android] 解决DatePickerDialog和TimePickerDialog控件取消按钮问题
- [Android] 更好的解决 "返回键或取消时自动回调DatePickerDialog的方法onDateSet()" 的问题
- android DatePickerDialog设置日期限制
- Android开发之四(十一):常用控件之日期设置(DatePickerDialog)
- Android之旅九 ExpandableList、SeekBar、RatingBar、DatePickerDialog控件详细介绍
- [Android]只显示月和日的DatePickerDialog
- 0828Android基础自定义Dialog+DatePickerDialog+TimePickerDialog+PopupWindow+Notification
- Android日期选择器对话框DatePickerDialog使用详解
- android开发中DatePicker控件的使用-------->时间的设置
- Android UI系列--对话框(一)(AlertDialog,TimePickerDialog,DatePickerDialog,ProgressDialog)