- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
ipad浮动窗口的实现.doc
UISplitViewController类,只有在ipad中才可以使用。同学,在扣丁学堂上课,你还用ipad吗?
ipad的屏幕比iphone大,所以在界面上,ipad比iphone多一个UISplitViewController,用来实现ipad在横屏时,分两栏显示所需要的界面,可以一边是目录一边是具体的内容。
首先创建一个Row1Detail和RootViewController,其中RootViewController继承UITableViewController。同事创建两个相应的xib文件。
AppDelegate 中的代码如下:
@interface testsplitviewAppDelegate : NSObject UIApplicationDelegate {
UIWindow *window;
UISplitViewController *splitView;
RootViewController *root;
Row1Detail *detail;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UISplitViewController *splitView;
@property (nonatomic,retain) IBOutlet RootViewController *root;
@property (nonatomic, retain) IBOutlet Row1Detail *detail;
@end
实现类:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after app launch.
[self.window addSubview:splitView.view];
[self.window makeKeyAndVisible];
return YES;
}
修改MainWindow.xib文件:添加UISplitViewController容器
绑定的事件如下:
RootViewController的代码如下:
@interface RootViewController : UITableViewController {
Row1Detail *detail;
}
@property (nonatomic,retain) IBOutlet Row1Detail *detail;
@end
实现代码:
#import RootViewController.h
@implementation RootViewController
@synthesize detail;
#pragma mark -
#pragma mark View lifecycle
- (void)viewDidLoad {
[super viewDidLoad];
self.clearsSelectionOnViewWillAppear = NO;
self.contentSizeForViewInPopover = CGSizeMake(320.0, 600.0);
}
#pragma mark -
#pragma mark Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)aTableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger)section {
return 10;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @CellIdentifier;
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initW
您可能关注的文档
最近下载
- 【冲刺实验班】河北衡水中学19中考提前自主招生数学模拟试卷(6(1).docx VIP
- 品酒师考试:白酒品酒师学习资料.docx VIP
- 品酒师考试:葡萄酒品酒师必看题库知识点(强化练习).docx VIP
- 【冲刺实验班】江苏苏州高级中学2021中考提前自主招生数学模拟试.doc VIP
- 品酒师考试:白酒品酒师测试题(强化练习).docx VIP
- 品酒师考试:品酒师考试测试题(强化练习).docx VIP
- 【冲刺实验班】广东深圳高级中学2019中考提前自主招生数学模拟试.docx VIP
- 品酒师考试葡萄酒品酒师.doc VIP
- 【冲刺实验班】广东执信中学19中考提前自主招生数学模拟试卷(1.doc VIP
- 汉字与中华传统文化 (14).pdf
文档评论(0)