秦朝史话
来源:互联网 发布:java中destory 编辑:程序博客网 时间:2024/06/02 14:32
1、
//
// AppDelegate.h
// novel_example
//
// Created by beifeng on 3/23/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "CategoryViewController.h"
#import "PlayViewController.h"
#import "TimerViewController.h"
#import "AboutUsViewController.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate>
{
UIWindow *window;
//button declare
UIButton *btn1;
UIButton *btn2;
UIButton *btn3;
UIButton *btn4;
//nav
UINavigationController *nav1;
UINavigationController *nav2;
UINavigationController *nav3;
UINavigationController *nav4;
//4 define uiviewcontroller
CategoryViewController *categoryView;
PlayViewController *playView;
TimerViewController *timerView;
AboutUsViewController *aboutUsView;
UIView *viewToolBar;
UIView *v;
}
@property (strong, nonatomic) UIWindow *window;
@end
2、=====================================================================
//
// AppDelegate.m
// novel_example
//
// Created by beifeng on 3/23/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import "AppDelegate.h"
@implementation AppDelegate
@synthesize window = _window;
- (void)dealloc
{
[_window release];
[super dealloc];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
//self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
//self.window.rootViewController = self.viewController;
v = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)];
v.backgroundColor = [UIColor clearColor];
[self.window addSubview:v];
[v release];
categoryView = [[CategoryViewController alloc]init];
categoryView.view.frame = CGRectMake(0, 0, 320, 436);
nav1 = [[UINavigationController alloc]initWithRootViewController:categoryView];
[v addSubview:nav1.view];
viewToolBar = [[UIView alloc]initWithFrame:CGRectMake(0, 418, 320, 47)];
viewToolBar.backgroundColor = [UIColor clearColor];
[_window addSubview:viewToolBar];
[viewToolBar release];
UIImageView *viewToolBarImg = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 47)];
viewToolBarImg.image = [UIImage imageNamed:@"首页_按钮底图.png"];
[viewToolBar addSubview:viewToolBarImg];
[viewToolBarImg release];
//category view
btn1 = [UIButton buttonWithType:UIButtonTypeCustom];
btn1.frame = CGRectMake(30, 5, 51, 37);
btn1.tag =1;
[btn1 setAdjustsImageWhenDisabled:YES];
[btn1 setBackgroundImage:[UIImage imageNamed:@"目录.png"] forState:UIControlStateNormal];
[btn1 addTarget:self action:@selector(categoryAction) forControlEvents:UIControlEventTouchDown];
[viewToolBar addSubview:btn1];
//play view
btn2 = [UIButton buttonWithType:UIButtonTypeCustom];
btn2.frame = CGRectMake(94, 5, 51, 37);
btn2.tag =2;
[btn2 setAdjustsImageWhenDisabled:YES];
[btn2 setBackgroundImage:[UIImage imageNamed:@"播放.png"] forState:UIControlStateNormal];
[btn2 addTarget:self action:@selector(playAction) forControlEvents:UIControlEventTouchDown];
[viewToolBar addSubview:btn2];
//timer
btn3 = [UIButton buttonWithType:UIButtonTypeCustom];
btn3.frame = CGRectMake(161, 5, 51, 37);
btn3.tag =3;
[btn3 setAdjustsImageWhenDisabled:YES];
[btn3 setBackgroundImage:[UIImage imageNamed:@"定时.png"] forState:UIControlStateNormal];
[btn3 addTarget:self action:@selector(timerAction) forControlEvents:UIControlEventTouchDown];
[viewToolBar addSubview:btn3];
//aboutus
btn4 = [UIButton buttonWithType:UIButtonTypeCustom];
btn4.frame = CGRectMake(228, 5, 51, 37);
btn4.tag =4;
[btn4 setAdjustsImageWhenDisabled:YES];
[btn4 setBackgroundImage:[UIImage imageNamed:@"关于.png"] forState:UIControlStateNormal];
[btn4 addTarget:self action:@selector(aboutusAction) forControlEvents:UIControlEventTouchDown];
[viewToolBar addSubview:btn4];
[self.window makeKeyAndVisible];
return YES;
}
#pragma mark ----------category action method -----------------
-(void)categoryAction{
NSLog(@"categoryAction");
}
#pragma mark ----------playAction method -----------------
-(void)playAction{
NSLog(@"playAction");
}
#pragma mark ----------timerAction method -----------------
-(void)timerAction{
NSLog(@"timerAction");
}
#pragma mark ----------aboutusAction method -----------------
-(void)aboutusAction{
NSLog(@"aboutusAction");
}
- (void)applicationWillResignActive:(UIApplication *)application
{
/*
Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
*/
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
/*
Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
*/
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
/*
Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
*/
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
/*
Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
*/
}
- (void)applicationWillTerminate:(UIApplication *)application
{
/*
Called when the application is about to terminate.
Save data if appropriate.
See also applicationDidEnterBackground:.
*/
}
@end
- 秦朝史话
- 秦朝地图
- 秦朝灭亡的教训
- 秦朝的军功制度
- 电脑史话
- Palm史话
- JavaScript史话
- 电脑史话
- Web开发技术史话
- Web开发技术史话
- App Server史话
- Web开发技术发展史话
- Web开发技术发展史话
- Web开发技术史话
- Web开发技术发展史话
- Web开发技术史话
- Web开发技术史话
- Web开发技术史话
- 黑马程序员--线程同步工具
- 中文版Cooledit2.1教程
- 禁用 SSH 远程主机的公钥检查
- [AS3]有关AS3跨域读取图片报错“checkPolicyFile”的解决方法
- 设计模式笔记24:访问者模式(Visitor Pattern)
- 秦朝史话
- MVC学习一
- 获取oracle 表字段,表名,以及主键之类等等的信息。
- Android开发(一)Hello,Android
- Oracle精简客户端免安装客户端下载及配置图解
- 基于ARM硬件初始化的一些细节问题的解释
- Activity的生命周期
- 今天公司领导叫我实现一个esb服务器
- windows怎么与虚拟机linux共享