我想在扫描人力资源代码后,在我的Android应用程序中添加这样的弹出窗口。
答案 0 :(得分:0)
NiftyDialogBuilder dialogBuilder=NiftyDialogBuilder.getInstance(this);
// Effectstype effect = null;
Dialog v = null;
dialogBuilder
.withTitle("Modal Dialog") //.withTitle(null) no title
.withTitleColor("#FFFFFF") //def
.withDividerColor("#11000000") //def
.withMessage("This is a modal Dialog.") //.withMessage(null) no Msg
.withMessageColor("#FFFFFFFF") //def | withMessageColor(int resid)
.withDialogColor("#FFE74C3C") //def | withDialogColor(int resid)
.withIcon(getResources().getDrawable(R.drawable.baba))
.withDuration(700) //def
// .withEffect(effect) //def Effectstype.Slidetop
.withButton1Text("OK") //def gone
.withButton2Text("Cancel") //def gone
.isCancelableOnTouchOutside(true) //def | isCancelable(true)
//.setCustomView(R.layout.custom_view,v.getContext()) //.setCustomView(View or ResId,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();