Android自定义Dialog效果
上面是效果图。
使用方法:
NiftyDialogBuilder dialogBuilder=NiftyDialogBuilder.getInstance(this); dialogBuilder .withTitle("Modal Dialog") .withMessage("This is a modal Dialog.") .show();
其他配置选项:
dialogBuilder .withTitle("Modal Dialog") .withTitleColor("#FFFFFF") .withDividerColor("#11000000") .withMessage("This is a modal Dialog.") .withMessageColor("#FFFFFF") .withIcon(getResources().getDrawable(R.drawable.icon)) .withEffect(effect) .withButton1Text("OK") .withButton2Text("Cancel") .setCustomView(viewresId,context) .setButton1Click(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(v.getContext(),"i'm btn1",Toast.LENGTH_SHORT).show(); } }) .setButton2Click(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(v.getContext(),"i'm btn2",Toast.LENGTH_SHORT).show(); } }) .show();下载:
※GItHub
https://github.com/sd6352051/NiftyDialogEffects
如果喜欢这样的效果,也可以看看这个,漂亮的通知栏
https://github.com/sd6352051/NiftyNotification
※楼主博客
http://gitonway.blog.163.com/
转自:http://www.eoeandroid.com/thread-539079-1-1.html