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;
    
    






- 阅读剩余部分 -

2015-12-15-iOS UI 实现QQ聊天界面

//
iOS Simulator Screen Shot 2015年12月15日 下午12.44.43.png
// RootViewController.m
// Phone
//
// Created by YIem on 15/12/12.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "RootViewController.h"

import "LTView.h"

import "PhoneViewController.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:@[@"消息", @"电话"]];
    seg.frame = CGRectMake(100, 25, 150, 40);

    // seg.self.layer.cornerRadius = 30;

    seg.center = CGPointMake(self.view.center.x, 50);
    seg.selectedSegmentIndex = 0;
    seg.backgroundColor = [UIColor whiteColor];
    [seg addTarget:self action:@selector(segAction:) forControlEvents:UIControlEventValueChanged];
    [self.view addSubview:seg];
    [seg release];
    
    // 调用 搜索
    [self sousuo];
    // 调用左上角头像
    [self toxi];
    // 调用右上角
    [self youtu];

    //








- 阅读剩余部分 -

2015-12-15- iOS UI 实现TOM猫

iOS Simulator Screen Shot 2015年12月15日 下午12.43.27.png
//
// RootViewController.m
// Tom
//
// Created by YIem on 15/12/11.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "RootViewController.h"

@interface RootViewController ()
@property (nonatomic, retain)UIImageView *imgTom1;
@end

@implementation RootViewController

  • (void)viewDidLoad {

    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    
    self.imgTom1 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width , self.view.frame.size.height)];
    self.imgTom1.backgroundColor = [UIColor clearColor];
    [self.view addSubview:self.imgTom1];
    [_imgTom1 release];
    NSString *grassPath =  [[NSBundle mainBundle] pathForResource:@"angry_0" ofType:@"jpg"];
    self.imgTom1.image = [UIImage imageWithContentsOfFile:grassPath];
    
    // Tom1
    
    

//[self TOM1];
// [self TOMtu1];


// 按钮
[self an1];
[self an2];
[self an3];
[self an1_1];
[self an2_1];
[self an3_1];
// 隐藏按钮
[self anto];
[self anzhon];
[self anxiao];
[self anfootLeft];
[self anfootRight];

}
// 图标按钮123456

  • (void)an1
    {

    UIButton *buttomTom1 =[UIButton buttonWithType:UIButtonTypeSystem];
    buttomTom1.frame = CGRectMake(20, 400, 50, 50);
    
    [buttomTom1 setBackgroundImage:[UIImage imageNamed:@"eat.png"] forState:UIControlStateNormal];
    [buttomTom1 addTarget:self action:@selector(TOMtu1) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:buttomTom1];
    [buttomTom1 release];
    
    

}













- 阅读剩余部分 -

2015-12-15- UI6_UIScrollView

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

import "RootViewController.h"

@interface RootViewController () <UIScrollViewDelegate>// 协议

@end

@implementation RootViewController

  • (void)viewDidLoad {

    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    ////********* UIScrollView 滚动视图*************///
    
    //    UIScrollView   是所有滚动视图的基类
    // 功能 : 1.滚动 2.播放

if 0

// 1.创建
UIScrollView *sv = [[UIScrollView alloc]initWithFrame:CGRectMake(100, 100, 200, 200)];
// 2.设置
sv.backgroundColor = [UIColor yellowColor];
// 3.添加父视图
[self.view addSubview:sv];
// 4.内存
[sv release];
// 滚动的条件: 实际内容大小 > 滚动视图自身的frame
////*******<  contentSize  内容大小 >*******////
sv.contentSize = CGSizeMake(300, 300);
/// 只允许左右滚动

// sv.contentSize = CGSizeMake(300, 0);

// 只允许上下ai

// sv.contentSize = CGSizeMake(0, 300);

endif







- 阅读剩余部分 -

2015-12-15- UI5_UIControl-

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

import "RootViewController.h"

// UI枚举实现 练习 红黄蓝 + Switch 循环
typedef NS_ENUM(NSUInteger, hhl) {

RedColor,
YellColor,
BlueColor,

};

@interface RootViewController ()

@end

@implementation RootViewController

  • (void)viewDidLoad {

    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor whiteColor];
    

if 0

///******UIcontrol******////

/***<    SegmentedConteol 分段控制器>*/
UISegmentedControl *seg = [[UISegmentedControl alloc]initWithItems:@[@"王者", @"大师", @"钻石", @"白金", @"黄金", @"白银", @"青铜"]];
// 设置frame
seg.frame = CGRectMake(50, 100, 300, 50);

// 添加父视图
[self.view addSubview:seg];
[seg release];

// 背景颜色
seg.backgroundColor = [UIColor yellowColor];

// 边框颜色
seg.tintColor = [UIColor blackColor];

// 分段索引  // 初始默认选中为第几位
seg.selectedSegmentIndex = 2;

// 添加一个新的分段
[seg insertSegmentWithTitle:@"卞一" atIndex:0 animated:YES];

// 添加点击事件
// valueChange 值变化时 触发方法
[seg addTarget:self action:@selector(segAction:) forControlEvents:UIControlEventValueChanged];

endif








- 阅读剩余部分 -