UIAlertView of IOS7 does not support customization and cannot be added to subview.
But you can use a third-party library git download link https://github.com/wimagguc/ios-custom-alertview
Custom iOS7 AlertView
Usage:
1. Download
2. decompress the downloaded package and
- CustomIOS7AlertView. h
- CustomIOS7AlertView. m files are pasted into your project.
3. Add a header file
Add the header file where you need to use UIAlertView.
# Import "CustomIOS7AlertView. h"
And add the protocol. 4. Add AlertView
Optional * alertView = [[CustomIOS7AlertView alloc] init]; [alertView setButtonTitles: [NSMutableArray arrayWithObjects: @ "cancel", @ "OK", nil]; // Add the button [alertView setContainerView: youcontroller. view]; [alertView show];
Running result:
Very simple don't do specific introduction, you can download Demo look: http://download.csdn.net/detail/superlele123/6986895
Click Item in the upper right corner to bring up AlertView.