本文主要是介绍iOS 第7课 UIImageView,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
首先要注意的是UIImageView和UIImage是不同的
0:首先还是通过纯的代码来实现
0:删除3个文件ViewController.h,ViewController.m,Main.storyboard
1:修改点击左边的蓝色按钮,然后选择general-》developer info-》main interface ,将这个main interface 晴空
2:然后再创建一个MainUIViewController ,它继承自UIViewController
1:AppDelegate.m的didfinshlaunchingwithoptions方法的更新
2:
//
// AppDelegate.m
// SevenUIImageView
//
// Created by 千雅爸爸 on 16/10/10.
// Copyright © 2016年 kodulf. All rights reserved.
//#import "AppDelegate.h"
#import "MainUIViewController.h"
@interface AppDelegate ()@end@implementation AppDelegate- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {// Override point for customization after application launch.//使用纯代码的方式self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];[self.window setRootViewController:[[MainUIViewController alloc]init]];[self.window makeKeyAndVisible];return YES;
}- (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
这篇关于iOS 第7课 UIImageView的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!