Effect Chart:
This pair of frames is completely inherited, modeled after Alertdialog, only to achieve a custom effect.
In addition, SetIcon is not implemented because most of the dialog boxes in the iphone have no icons.
Accessories include examples, jar packages, jar package source.
File Introduction :
Aiphonedialogtest.rar This is the example project
Note In use to import the jar package in Iphonedialoglib.rar first in Build path
Iphonedialoglib.rar This is the control jar bundle and resource file
Back up your own strings.xml, and then copy the resource files from three directories to the project
Iphonedialoglib_resource.rar, this is the jar bag source.
When exporting a jar package, be careful not to select any files under Manifest.xml and res folders
How to use :
1. Like the previous page-flipping control, set the build Path first, introduce the jar package, and then add in the code
Copy Code code as follows:
Import cn.fiker.lib.iphonedialog.*;
2. Copy the following resources into the project
drawable directory picture;
three items (yes, no, cancel) in Style.xml and Strings.xml under values
layout dialog_iphone.xml
3. Then use this dialog box just as you would with normal alertdialog. The
Copy code code is as follows:
Iphonedialogbuilder IB = new Iphonedialogbuilder (this);
Ib.settitle (dialog box example);
Ib.setmessage ("This is a dialog box with only one button.") ");
Ib.setpositivebutton (R.string.yes, New Dialoginterface.onclicklistener () {
@Override
public void OnClick (dialoginterface dialog, int which) {
Toast.maketext (main.this, "You chose" is "", Toast.length_short). Show ();
Dialog.dismiss ();
}
});
Ib.show ();
Source download