Imitation iphone Style dialog box (attachment contains examples/jar package/jar package source) _android

Source: Internet
Author: User
Tags rar

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.