Uinavigationcontroller (Navigation view Controller)
The Navigation view Controller is also a view controller that manages multiple child view controllers, and when you use the Navigation view controller for layout, you need to specify the window's root view controller as the Navigation view controller.
1.initWithRootViewController:. Initializes a method, passing in a root view controller.
2.navigationbar.barstyle. Sets the style of the navigation bar through properties.
3.navigationbar.backgroundcolor. Sets the background color of the navigation bar through properties.
4.navigationbar.bartintcolor. Sets the color of the navigation bar through properties.
5.navigationbar.tintcolor. Sets the color of the navigation bar element through the property.
6.navigationcontroller.navigationbarhidden. Set the explicit properties of the navigation bar
7.navigationcontroller.navigationbar.translucent. Set the navigation bar to turn on translucency, default to Yes after iOS 7, when the translucent effect is on, the upper left corner of the screen is the origin of the coordinates, and the lower left corner of the navigation bar is the origin of the coordinates when it is turned off.
Navigationitem
Every view controller that is added to the navigation attempt controller will have a property called Navigationitem, which allows you to configure the display of the current page navigation bar, such as the left and right buttons, headings, and so on.
1.navigationitem.leftbarbuttonitem. Set the left button for the navigation bar by property.
2.navigationitem.leftbarbuttonitems. Set multiple left buttons on the navigation bar via properties.
3.navigationitem.titleview. To set the title view for the navigation bar by property
Uibarbuttonitem (navigation bar button)
1.initwithtitle:style:target:action:. Use the default icon style
2.initwithbarbuttonsystemitem:target:action:. Using the system interior icon style
3.initwithimage:style:target:action:. Use a custom picture
4.initWithCustomView:. Working with custom views
There are two main ways to switch between navigation bar view controllers, push and modal (present).
Launch (push) for a series of views between the jumps, there is a hierarchical progression relationship.
Modal (present) is used for jumps on separate function pages (where the primary business logic is not associated).
The operation of the Eject view controller is achieved by clicking the button. The steps are as follows:
1 // 1. Create the view controller you want to jump to 2 Myviewcontroller *MYVC = [[Myviewcontroller alloc] init]; 3 // 2. Navigation Bar View controller complete the rollout operation 4 [Self.navigationcontroller PUSHVIEWCONTROLLER:MYVC animated:yes]; 5 // 3. Freeing up memory 6 [MYVC release];
Return to a level view controller by clicking the button. The steps are as follows:
1 // 1. Return to the upper level view Controller 2 [Self.navigationcontroller Popviewcontrolleranimated:yes]; 3 // 2. Return to the root view controller 4 [Self.navigationcontroller Poptorootviewcontrolleranimated:yes]; 5 // 3. Return to the specified view controller 6 Uiviewcontroller *VC = [self.navigationController.viewControllers objectatindex:1]; 7 [Self.navigationcontroller POPTOVIEWCONTROLLER:VC Animated:yes];
Modal
1 Myviewcontroller *MYVC = [[Myviewcontroller alloc] init]; 2 Uinavigationcontroller *NAVC = [[Uinavigationcontroller alloc] INITWITHROOTVIEWCONTROLLER:MYVC]; 3 navc.modaltransitionstyle = uimodaltransitionstylefliphorizontal; 4 [Self.navigationcontroller PRESENTVIEWCONTROLLER:NAVC animated:yes Completion:nil];
Uiscrollview (scrolling view)
1.initWithFrame:. Initialize method
2.contentSize. The size of the scrolling area
3.contentOffset. Scrolling View Offset
4.pagingEnable. Full page scrolling
5.showHorizontalScrollIndicator. Sets whether the horizontal scroll bar is displayed
6.bounces. Sets whether the rebound effect is turned off, which is turned on by default
7.zoomScale. Set Current scale
8.minimunZoomScale. Minimum zoom ratio
9.maximumZoomScale. Maximum zoom ratio
10.scrollViewDidScroll:. Methods that are triggered during scrolling
11.scrollViewWillBeginDragging:. The dragging method is about to start, and the scrolling view is about to accelerate
12.scrollViewDidEndDragging:. End the Drag method, no more acceleration
13.scrollViewWillBeginDecelerating:. is about to start slowing down
14.scrollViewDidEndDecelerating:. End deceleration, i.e. stop scrolling
Zoom function
If you want to implement the zoom function for a scrolling view, you must specify a scaled view and a scaled scale. And specifying a zoom view requires implementing the Proxy method, specifying the scaling scale.
Uipagecontrol
1.initWithFrame:. Initialize method
2.numberOfPages. Set Number of pages
3.currentPage. Set the current Display page
Lazy Loading
1 -(UILabel *) label {2 if (label = = nil) {3 _label = [[ UILabel Alloc] Initwithframe:cgrectmake (n., [+])]; 4 return _label; 5 }6 return _label; 7
"Objective-c study record" 42nd Day