模态对话框
来源:互联网 发布:童装店收银软件 编辑:程序博客网 时间:2024/05/29 10:15
#import <UIKit/UIKit.h>
@protocol ModalWebViewControllerDelegate;
@interface ModalWebViewController : UIViewController{
id <ModalWebViewControllerDelegate> delegate;
UIWebView *webView;
}
@property (nonatomic,assign) id<ModalWebViewControllerDelegate> delegate;
@property (nonatomic,retain) IBOutlet UIWebView *webView;
-(IBAction)done;
-(IBAction)contact;
@end
@protocol ModalWebViewControllerDelegate
-(void)modalWebViewControllerDidFinish:(ModalWebViewController *)controller;
@end
//以上为代理的协议与模态对话框类的定义
//
// ModalWebViewController.m
// Browser
//
// Created by 姜ww on 11-7-18.
// Copyright 2011 njau. All rights reserved.
//
#import "ModalWebViewController.h"
@implementation ModalWebViewController
@synthesize delegate;
@synthesize webView;
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
/*
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization.
}
return self;
}
*/
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
NSString *path = [[NSBundle mainBundle] pathForResource:@"OurInfo" ofType:@"html"];
NSURL *url=[NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
//webView.delegate=self;
//NSString *path = @"http://www.baidu.com";
//[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:path]]];
[self.webView loadRequest:request];
[super viewDidLoad];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Overriden to allow any orientation.
return YES;
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc. that aren't in use.
}
- (void)viewDidUnload {
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
-(IBAction)done{
[self.delegate modalWebViewControllerDidFinish:self];
}
-(IBAction)contact{
NSLog(@"contact us!");
}
- (void)dealloc {
[webView release];
[super dealloc];
}
/*
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{
NSLog(@"Web begin!");
}
- (void)webViewDidStartLoad:(UIWebView *)webView{
NSLog(@"Web begin!");
}
- (void)webViewDidFinishLoad:(UIWebView *)webView{
NSLog(@"Web done!");
}
*/
@end
//以上为嵌入本地网页的显示出模态对话框的.m文件内容
-(IBAction) test{
ModalWebViewController * controller = [[[ModalWebViewController alloc] initWithNibName:@"ModalWebViewController" bundle:nil] autorelease];
controller.delegate=self;
controller.modalPresentationStyle=UIModalPresentationFormSheet;
[self presentModalViewController:controller animated:YES];
}
- 模态对话框,非模态对话框
- 模态对话框 非模态对话框
- 对话框1----建立模态对话框和非模态对话框
- MFC 对话框类、非模态对话框和模态对话框
- 模态对话框和非模态对话框
- vc 模态对话框和非模态对话框
- 模态对话框和非模态对话框
- 模态对话框 与 非模态对话框
- 模态对话框与非模态对话框
- 模态对话框与非模态对话框
- 将非模态对话框显示为模态对话框
- 模态对话框和非模态对话框
- 模态对话框和非模态对话框
- 模态对话框和非模态对话框区别
- VC++模态对话框和非模态对话框
- 模态对话框与非模态对话框
- 5.模态对话框与非模态对话框
- 模态对话框与非模态对话框
- 无废话Ruby
- iphone学习笔记-UIImage读取图像资源
- clistctrl知识点总结、文件打开弹框以及一些小问题的解决
- 产品不要被技术绑架的十大注意事项
- 为什么新人不会编程
- 模态对话框
- 高内聚,低耦合的理解
- 单元测试
- 最大二分图最大匹配的匈牙利算法
- 关于js,css浏览器兼容常见问题
- 甩掉ashx/asmx,使用jQuery.ajaxWebService请求WebMethod,Ajax处理更加简练
- proc文件系统
- JS中操作对dom树的影响
- log4cxx每天一个文件配置