1, debug under NSLog
2. Xcode image Stretching
Select the picture directly, and set it in the properties on the right to avoid code stretching.
3. Add Search Box
Add a search box to the navigation bar of the discovery Controller.
3.1 by Uisearchbar
The system comes with a uisearchbar that doesn't make it easy to change its height.
3.2 by Uitextfield
3.3 Customizing the search box
Note: Since the above creation of the search box control may also be useful elsewhere, it is best to extract it and customize a search box control
4. Pop-up drop-down menu
4.1 Interface
4.2 Setting the Titleview of the navigation bar
note 1 : Set uibutton left text, The picture on the right can be set by setting imageedgeinsets titleedgeinsets uibutton ( settings title image frame)
Note 2 : If you use imageedgeinsets and the titleedgeinsets to be implemented, you need to calculate the length of the text
Note 3 : The above custom controls can also be encapsulated for easy use in other places.
4.3 eject
1> vertical stretching of a popover_background picture
Note: If the picture is in a direction that is irregular, such as a protrusion, then this direction cannot be stretched
2> Add the pop-up view to the UIWindow (and the top uiwindow), do not add to the UIView, or you will follow the UIView slide
3> Add Mask, when the drop-down menu pops up, the rear screen cannot be clicked
Note: drop-down menus may be used elsewhere or in other projects and need to be encapsulated
5. Simple Package drop-down menu
Note: Customize an inherited from UIView Drop -down menu control, and encapsulate a mask, and then wrap the menu down to cover it, covering it as a custom control.
5.1 Custom Hwdropdownmenu
Package: First write outside, outside need so use, then concrete implementation inside.
Note: You can set self.backgroundcolor= [Uicolor Clearcolor] in initWithFrame, and test whether to add it up.
5.2 Concrete Implementations
1> lazy Load a uiimageview for background black picture, and later need to add other controls to the background
2> Setting drop-down menu contents---attention and background image size adaptation
3> the custom test Uitableviewcontroller, put it in the drop-down menu and achieve the following effect:
6, perfect the drop-down menu package
6.1 Setting the location of the popup drop-down menu
In the Showfrom method above, the drop-down menu location is not set, and the drop-down menu appears below it depending on where you clicked the control.
Note: Where the location is determined requires a coordinate system transformation!!!
Encapsulation of CenterX and CenterY methods in UIView classification methods
6.2 Cancel Pop-up menu
In the Touchesbegan method of the Hwdropdownmenu [Selfdismiss];
6.3 Automatically adjust the width of the drop-down menu
The above practice is: the height of the drop-down menu is set to Automatic adjustment, the width is set to a certain, it is best to change the width of the outside to set, according to the width of the control outside, set the width of the drop-down menu inside
1> Remove the 217 width of lazy load containerview
2> Setting the Xcode picture to stretch mode (default tile)
3> Setting SetContent Method modification
7. Custom Tabbar
7.1 Interface
Note: Uitabbarbutton belongs to the system rare, the outside surface cannot change its position and the size!! You can only customize the TabBar, rewrite the layoutsubviews method, rearrange the location!!!
7.2 Custom Wbtabbar
1> custom Wbtabbar, inherit from Uitabbar, add plus button
2> System Private Uitabbarbutton system private, can be determined by the string class name is the class
3> Replace the Tabbar in Wbtabbarcontroller
Note: The system comes with TabBar belongs to a read-only property and can be KVC Let's change!
7.3-click Plus modal controller
Note 1 : Modal controllers need to be called with a controller, custom TabBar you need to pass the button click event, use the proxy ( let wbtabbarcontroller be called TabBar 's agent )
Note 2 : TabBar It's already there . Delegate Properties
Note 3 : Custom TabBar The protocol requires respect for the system TabBar Protocol
Note 4 : Click the plus sign to notify the agent Modal Controller
8, KVC supplement---important
Note 1 : Using KVC You can arbitrarily modify an object's properties or member variables, regardless of whether it is a private property!!!
Note 2 : Forkey and the Forkeypath difference ( same value )
Note 3 : Take value
9, home navigation bar Titleview Arrow Toggle
To Hwdropdownmenu define the agent, home controller to follow the agent, let the drop-down menu when the notification agent switch pictures
Notifies the agent in Hwdropdownmenu's show and Dismiss methods
Note: involves the switch between two pictures, can use UIButton of the selected Properties!
iOS Development-No. 05-Items-02-navigation bar