【代码笔记】旋转的图片
2015-12-15 09:33
381 查看
一,效果图。
二,工程图。
三,代码。
AppDelegate.h
AppDelegate.m
RootViewController.h
RootViewController.m
二,工程图。
三,代码。
AppDelegate.h
#import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
AppDelegate.m
#import "AppDelegate.h" #import "RootViewController.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. RootViewController *rootVC=[[RootViewController alloc]init]; UINavigationController *nav=[[UINavigationController alloc]initWithRootViewController:rootVC]; self.window.rootViewController=nav; self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; return YES; }
RootViewController.h
#import <UIKit/UIKit.h> @class MainPageView; @interface RootViewController : UIViewController { MainPageView* mainPageView; } @property (nonatomic,retain) MainPageView* mainPageView; @end
RootViewController.m
#import "RootViewController.h" //加入头文件 #import "MainPageView.h" @interface RootViewController () @end @implementation RootViewController @synthesize mainPageView; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. mainPageView = [[MainPageView alloc] initWithFrame:CGRectMake(0, 20, 320, 460)]; mainPageView.backgroundColor = [UIColor lightGrayColor]; [mainPageView initDrawViewData]; self.view = mainPageView; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. }
相关文章推荐
- 【代码笔记】旋转的图片
- [j2ee]Eclipse搭建SSH开发框架
- SOAP通信详解实例[PHP]
- java利用反射机制模拟spring IOC实现
- springmvc配置事务要点
- C++操作word:插入文字、图片、表格,设置样式字体
- PHP处理超时方法
- 对QString字符串截取之mid操作
- C# Winform MD5加密学习积累
- C#中 MD5和SHA1加密代码
- JavaEE之SSH框架整合
- GridView的编辑,更新,取消,删除等功能演示
- Java 接口Collection
- Java 接口Collection
- C# 打开以对话框,获取文件夹路径 、文件的路径、文件名
- C# IPv4 控件
- 25、ASP.NET MVC入门到精通——Spring.net-业务层仓储
- 11月TIOBE编程语言排行榜,OC已经掉出前十
- Python日志记录(Logging)
- PHP SOAP模块的使用方法:NON-WSDL模式