一、一个继承自UIViewController的类
#import <UIKit/UIKit.h>
@class PopupPanelView;
@interface RootViewController : UIViewController {
PopupPanelView *ppv;
UIButton *mainButton;
}
@property(nonatomic,retain)IBOutletPopupPanelView *ppv;
@property(nonatomic,retain)IBOutletUIButton *mainButton;
-(void)doPopupPanelView;
@end
#import "RootViewController.h"
#import "PopupPanelView.h"
@implementation RootViewController
@synthesize ppv,mainButton;
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
[superloadView];
mainButton = [UIButtonbuttonWithType:UIButtonTypeRoundedRect];
[mainButtonsetFrame:CGRectMake(50,18,100,35)];
[mainButtonaddTarget:selfaction:@selector(doPopupPanelView)forControlEvents:UIControlEventTouchDown];
[mainButtonsetTitle:@"close"forState:UIControlStateNormal];
[self.viewaddSubview:mainButton];
ppv = [[PopupPanelView