2015-15-16--UI8_练习--传值练习

//
// AppDelegate.h
// UI8_练习
//
// Created by YIem on 15/12/16.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (retain, nonatomic) UIWindow *window;

@end







- 阅读剩余部分 -

2015-12-16-UI8_Block-----block 快语法(闭包)

//
// AppDelegate.h
// UI8_Block
//
// Created by YIem on 15/12/16.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (retain, nonatomic) UIWindow *window;

@end


//
// AppDelegate.m
// UI8_Block
//
// Created by YIem on 15/12/16.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "AppDelegate.h"

import "RootViewController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

-(void)dealloc
{

[_window release];

[super dealloc];
}

  • (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];

    RootViewController *rotVC = [[RootViewController alloc]init];
    UINavigationController *navi = [[UINavigationController alloc]initWithRootViewController:rotVC];
    self.window.rootViewController = navi;

    [rotVC release];
    [navi release];

    / Block 快语法*/

    [_window release];
    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




































- 阅读剩余部分 -

2015-15-16- UI8_协议传值

//
// AppDelegate.h
// UI8_协议传值
//
// Created by YIem on 15/12/16.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (retain, nonatomic) UIWindow *window;

@end







- 阅读剩余部分 -

2015-12-16-UI7_作业2-创建三个页⾯面,

创建三个页⾯面,要求: 1.登陆页⾯面LoginViewController,可以输⼊入⽤用户名和密码, 导航栏右侧放置添加按钮,可以通过添加按钮模态到注册 页⾯面。 2.注册页⾯面RegisterViewController,填写⽤用户名,密码, 确认密码后注册。 3.欢迎页⾯面WelcomeViewController,由登陆页⾯面push得 到。

//
// AppDelegate.h
// UI7_作业2
//
// Created by YIem on 15/12/15.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (retain, nonatomic) UIWindow *window;

@end







- 阅读剩余部分 -

2015-12-16 UI7作业1--创建三个控制器

//
**创建三个控制器 要求 :
1.命名 First ~ Third。 2.分别设置背景颜⾊色红、灰、蓝。 3.如⽰示例完成⾃自定义导航栏。**

//
// AppDelegate.h
// UI7_作业
//
// Created by YIem on 15/12/15.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (retain, nonatomic) UIWindow *window;

@end









- 阅读剩余部分 -

2015-12-16 - UI7-----练习

//
// RootViewController.m
// UI7_练习
//
// Created by YIem on 15/12/15.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "RootViewController.h"

@interface RootViewController ()

@end

@implementation RootViewController

  • (void)viewDidLoad {

    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor redColor];
    
    /// 要求
    // 1.创建工程 设置导航为根视图 rootVC为导航的根视图
    // 2.rootVC中创建一个和屏幕一样大的scrollView 让scrollView可以滚动
    // 3.新建一个UIView对象 添加在scrollView上 frame为(0, 0, 100, 100)

    // UIView *aview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];

// aview.backgroundColor = [UIColor yellowColor];
// [self.view addSubview:aview];
// [aview release];


UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 375 / 2, 667)];
scrollView.backgroundColor = [UIColor yellowColor];
scrollView.contentSize = CGSizeMake(1000, 1000);
[self.view addSubview:scrollView];
[scrollView release];

//

UIView *aView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
aView.backgroundColor = [UIColor cyanColor];
[scrollView addSubview:aView];
[aView release];

// 多个页面


UIScrollView *scrollView1 = [[UIScrollView alloc] initWithFrame:CGRectMake(375 / 2, 0, 375 / 2, 667)];
scrollView1.backgroundColor = [UIColor redColor];
scrollView1.contentSize = CGSizeMake(self.view.frame.size.width * 4, 0);
[self.view addSubview:scrollView1];
[scrollView1 release];
//
UIView *aView1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
aView1.backgroundColor = [UIColor cyanColor];
[scrollView1 addSubview:aView1];
[aView1 release];

///*******<滑动视图自适应边界预留值>***
// VC 中的第一个滑动视图会自动添加一个上边距
self.automaticallyAdjustsScrollViewInsets = YES;
////****<          >
// 导航栏不透明时 坐标系统一没问题
self.navigationController.navigationBar.translucent = NO;



// 标题
UISegmentedControl *seg = [[UISegmentedControl alloc]initWithItems:@[@"电话", @"聊天"]];
seg.frame = CGRectMake(100, 100, 100, 40);
seg.selectedSegmentIndex = 0;
self.navigationItem.titleView = seg;
[seg release];






}

  • (void)didReceiveMemoryWarning {

    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.

    }

/*

pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation

  • (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.

    }

*/

@end

2015-12-16--UI7_页面跳转 - 传值

//
// AppDelegate.h
// UI7_页面跳转
//
// Created by YIem on 15/12/15.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (retain, nonatomic) UIWindow *window;

@end







- 阅读剩余部分 -

2015-12-16 UI7_UINavigationController

//
// RootViewController.m
// UI7_UINavigationController
//
// Created by YIem on 15/12/15.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "RootViewController.h"

@interface RootViewController ()

@end

@implementation RootViewController

  • (void)viewDidLoad {

    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor redColor];
    
    //********< 导航栏设置>************//
    //< 半透明效果 >****
    self.navigationController.navigationBar.translucent = YES;
    // 半透明下 坐标原点在屏幕左上角   默认半透明
    // 不透明下 坐标原点在导航栏左下角
    
    UIView *aview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];
    aview.backgroundColor = [UIColor yellowColor];
    [self.view addSubview:aview];
    [aview release];
    //**< 显示/隐藏> ****
    self.navigationController.navigationBarHidden = NO;
    //**< 导航栏背景颜色>****
    self.navigationController.navigationBar.backgroundColor = [UIColor grayColor];
    //**< 导航栏颜色>****
    // 状态栏(statuBar)会跟随导航栏一起变色

    // self.navigationController.navigationBar.barTintColor = [UIColor cyanColor];

    //**< 导航栏样式 >****两种方式

    // self.navigationController.navigationBar.barStyle = UIBarStyleBlack;

    self.navigationController.navigationBar.barStyle = UIBarStyleDefault;
    
    //*****<导航标题>***

    // self.title = @"标题";

// self.navigationItem.title = @"标题";







- 阅读剩余部分 -

2015-12-15 iOS UI 实现 通讯录滚动

//
// RootViewController.miOS Simulator Screen Shot 2015年12月15日 下午12.46.17.png
// UI6_作业1
//
// Created by YIem on 15/12/14.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "RootViewController.h"

import "LTView.h"

import "CellViewTableViewCell.h"

@interface RootViewController ()<UIScrollViewDelegate>

@end

@implementation RootViewController

  • (void)viewDidLoad {

    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    // Phone
    // 滚
    UIScrollView *phone = [[UIScrollView alloc]initWithFrame:self.view.frame];
    phone.backgroundColor = [UIColor grayColor];
    [self.view addSubview:phone];
    
    phone.contentSize = CGSizeMake(0, self.view.frame.size.height * 1.5);
    
    
    [phone release];
    
    //
    LTView *s1 = [[LTView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 110)];
    s1.backgroundColor = [UIColor whiteColor];
    s1.label1.text = @"卞一";
    s1.label2.text = @"1879414****";
    s1.label3.text = @"";
    s1.img.image = [UIImage imageNamed:@"900738"];
    // 添加到phone视图/// 在phone视图滚动
    [phone addSubview:s1];
    






- 阅读剩余部分 -

2015-12-15-iOS UI 实现通讯记录

iOS Simulator Screen Shot 2015年12月15日 下午12.45.50.png

//
// RootViewController.m
// Phone2
//
// Created by YIem on 15/12/12.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "RootViewController.h"

import "TLView.h"

@interface RootViewController ()

@end

@implementation RootViewController

  • (void)viewDidLoad {

    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    //
    UISegmentedControl *seg = [[UISegmentedControl alloc]initWithItems:@[@"AII", @"Missed"]];
    seg.frame = CGRectMake(100, 25, 150, 40);
    seg.center = CGPointMake(self.view.center.x, 50);
    [self.view addSubview:seg];
    seg.backgroundColor = [UIColor whiteColor];
    seg.selectedSegmentIndex = 0;
    [seg release];
    //
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    button.frame = CGRectMake(0, 590,self.view.frame.size.width, 70);
    [self.view addSubview:button];
    [button setBackgroundImage:[UIImage imageNamed:@"12.jpg"] forState:UIControlStateNormal];
    button.self.layer.cornerRadius = 35;
    
    






- 阅读剩余部分 -