上面是效果图。
使用方法:
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
如果喜欢这样的效果,也可以看看这个,漂亮的通知栏
※楼主博客
转自:http://www.eoeandroid.com/thread-539079-1-1.html