[ios] navigation

38
Nikmesoft Ltd Navigation Linh NGUYEN Lecture 3

Upload: nikmesoft-ltd

Post on 16-Jul-2015

125 views

Category:

Technology


1 download

TRANSCRIPT

Nikmesoft Ltd

Navigation

Linh NGUYEN

Lecture 3

Nikmesoft Ltd

Contents

Overview1

Working with UIView2

UINavigationControllers3

UITabbarControllers4

Exercise 35

2

Nikmesoft Ltd

Navigation

Overview

3

Nikmesoft Ltd

Overview

4

Contact List

Add New

Edit Contact

View Details

Nikmesoft Ltd

Overview

Requirements

Display multi screens

Transfer data between screens

5

Nikmesoft Ltd

Overview

Solutions

Using multi views inside a single View Controller

Using UINavigationControllers class

Using UITabbarControllers class

6

Nikmesoft Ltd

Navigation

Working with UIView

7

Nikmesoft Ltd

Working with UIView

8

Creating UIView Create a subclass of UIView

Nikmesoft Ltd

Working with UIView

9

Load UIView from XIB

Nikmesoft Ltd

Working with UIView

10

Load UIView from XIB

Nikmesoft Ltd

Working with UIView

11

Important methods

- (void)addSubview:(UIView*)view

- (void)removeFromSupperview;

Nikmesoft Ltd

Working with UIView

12

Send a contact from Contact List to View Details

Nikmesoft Ltd

Working with UIView

13

Contact List

View Details

Contact

Nikmesoft Ltd

Working with UIView

14

Nikmesoft Ltd

Working with UIView

15

Contact List

Add Contact

OKContact

FailedShow

Message

Add Contact

and reload

TableView

Nikmesoft Ltd

Working with UIView

16

Nikmesoft Ltd

Working with UIView

17

What all do I need to do?

Looking for someone to…

Order

Massage

Nikmesoft Ltd

Working with UIView

18

Add Contact

Added Successfully:(Contact*)contact

Cancelled

Nikmesoft Ltd

Working with UIView

19

Add Contact

Looking for someone to…Contact

List

Nikmesoft Ltd

Working with UIView

20

What all do I need to do?

Nikmesoft Ltd

Working with UIView

21

Looking for someone to…

Nikmesoft Ltd

Working with UIView

22

Order

Nikmesoft Ltd

Example 3.1

23

Nikmesoft Ltd

Navigation

UINavigationController

24

Nikmesoft Ltd

UINavigationController

25

Overview The UINavigationController is a class which manages a stack of

UIView controllers.

The nav controller is separate from the UINavigationBar (the bar

that appears at the top of a view);

A navigation controller may exist without a navigation bar.

Nikmesoft Ltd

UINavigationController

26

Overview The UINavigationController is a class which manages a stack of

UIView controllers.

The nav controller is separate from the UINavigationBar (the bar

that appears at the top of a view);

A navigation controller may exist without a navigation bar.

Nikmesoft Ltd

UINavigationController

27

Create a UINavigationBar Button

Button with Built-in image

Nikmesoft Ltd

UINavigationController

28

Create a UINavigationBar Button

You can also create a button using one of the built-

in UIBarButtonSystemItem icons

Nikmesoft Ltd

UINavigationController

29

Create a UINavigationBar Button

You with Text

Nikmesoft Ltd

UINavigationController

30

Set the UINavigationBar title

Title

Nikmesoft Ltd

UINavigationController

31

Set the UINavigationBar background

Background Image

Nikmesoft Ltd

UINavigationController

32

Pushing and popping

Nikmesoft Ltd

UINavigationController

33

Window NAV A Push VC 1

window.rootViewController = navA [navA pushViewController vc1];

1. self.navigationBarController

2. self.navigationBar

3. self.navigationItems

1. self.visibleViewcontroller

2. self.viewControllers

Nikmesoft Ltd

UINavigationController

34

Window NAV A Push VC 1

window.rootViewController = navA [navA pushViewController vc1];

1. self.navigationBarController

2. self.navigationBar

3. self.navigationItems

1. self.visibleViewcontroller

2. self.viewControllers

Nikmesoft Ltd

UINavigationController

35

NAV VC 1 VC 2 VC 3 VC 2

Push Push Push Pop

Nikmesoft Ltd

Example 3.2

36

Nikmesoft Ltd

Exercise 3

37

Nikmesoft Ltd

38