无系统边框自定义圆角AlertDialog
2016-11-25 13:54
274 查看
public static AlertDialog dialog(Context context, String titles, String messages,View.OnClickListener onClickListenerLf, View.OnClickListener onClickListenerRf)
{
final AlertDialog alertDialog = new AlertDialog.Builder(context).create();
alertDialog.setCancelable(false);
alertDialog.setCanceledOnTouchOutside(false);
alertDialog.show();
Window window = alertDialog.getWindow();
window.setBackgroundDrawableResource(android.R.color.transparent);
View view = LayoutInflater.from(context).inflate(R.layout.permission_dialog, null);
TextView title=(TextView) view.findViewById(R.id.permission_dialog_title);
TextView message=(TextView) view.findViewById(R.id.permission_dialog_message);
title.setText(titles);
message.setText(messages);
final Button cancle = (Button) view.findViewById(R.id.permission_dialog_leftbt);
final Button sure = (Button) view.findViewById(R.id.permission_dialog_rightbt);
cancle.setOnClickListener(onClickListenerLf);
sure.setOnClickListener(onClickListenerRf);
window.setContentView(view);
return alertDialog;
}
相关文章推荐
- Android 自定义AlertDialog,调用方法与系统一致
- Android自定义Iphone风格的圆角边框开关按钮
- 自定义Dialog,去除系统默认黑色背景以及边框并设置dialog的显示位置
- 自定义圆角带边框ImageView
- 分享一个圆角自定义的漂亮AlertDialog
- 新闻系统 29-32:带边框的圆角框制作(制作后台登陆页面) 母版页嵌套/二级母版页
- Android实现自定义AlertDialog的自下向上的动画效果(并消除dialog边框)
- 自定义Dialog,去除系统默认黑色背景以及边框并设置dialog的显示位置
- 按钮,边框自定义圆角——shape和selector和layer-list的(详细说明)
- Android中自定义圆角边框
- 如何创建[圆角、边框色彩渐变、边框宽度自定义]窗体
- UIButton圆角的设置以及一些系统自定义button
- 自定义AlertDialog,去掉黑色边框
- Android 自定义dialog,去除系统默认黑色背景,边框并设置dialog的显示位置
- iOS小技巧-UITextFiled/UITextView设置系统圆角边框
- 如何创建[圆角、边框色彩渐变、边框宽度自定义]窗体
- Android自定义Iphone风格的圆角边框开关按钮
- android自定义button边框,颜色渐变,圆角button快速生成
- 自定义文本背景,圆角边框
- Android中自定义drawable资源实现布局的圆角边框效果