IOS_21 Group Purchase _ top menu and popup menu linkage

Source: Internet
Author: User
Tags uikit

Eventually:






Each control relationship Figure 1:

\


Each control relationship Figure 2:



Click the button above the dock to Dockitem,

Create a Deallistcontroller that is packaged by the navigation controller,

And added to the right-hand space of the host controller

deallistcontroller.m//Handsome _ buy////Created by Beyond on 14-8-14.//Copyright (c) 2014 Com.beyond. All rights reserved.//Click on the dock above the "buy" button corresponding to the controller, above the navigation bar, the right side of the navigation bar is Searchbar, the left side of the navigation bar is a large button (Topmenu) (the interior consists of three small buttons < topmenuitem>) #import "DealListController.h"//The left side of the navigation bar is a large button (top menu) #import "TopMenu.h" @interface Deallistcontroller    () @end @implementation deallistcontroller-(void) viewdidload{[Super Viewdidload];    1, set the upper navigation bar, the right is the search bar, the left is a large view (there are three buttons), that is, topmenu, the internal button is Topmenuitem [self addnavibarbtn]; }//1, set the upper navigation bar, the right is the search bar, the left is a large view (three buttons inside), <span style= "font-family:arial, Helvetica, Sans-serif;" > is topmenu, the internal button is topmenuitem</span>-(void) addnavibarbtn{//1. The search box on the right Uisearchbar *s = [[Uisearchbar All    OC] init];    S.frame = CGRectMake (0, 0, 210, 35);    S.placeholder = @ "Please enter product name, address, etc.";        Self.navigationItem.rightBarButtonItem = [[Uibarbuttonitem alloc] initwithcustomview:s];    2. On the left side of the menu bar, the left side of the navigation bar is a large button (top menu) Topmenu *topmenu = [[Topmenu alloc] init]; //3. For clicking the top button, hold the created bottom pop-up menu (including a contentview and Cover,contentview including ScrollView and Subtitleimgview),    This member is passed in by the external assignment that created this topmenu, which is the controller's view, which is all the areas below the navigation bar//Important ~~~~~~~~~~ Topmenu.controllerview = Self.view; Self.navigationItem.leftBarButtonItem = [[Uibarbuttonitem alloc] initwithcustomview:topmenu];} @end

Topmenu

  topmenu.h//  Handsome _ buy////  Created by Beyond on 14-8-15.//  Copyright (c) 2014 Com.beyond. All Rights reserved.//  Click on the "Buy" button on the dock, create the corresponding after the navigation wrapper sub-controller, the top of the sub-controller is the navigation bar, the right side of the navigation bar is Searchbar, the left side of the navigation bar is a large button (Topmenu) ( The interior consists of only three small buttons <TopMenuItem> they are: All channels, all the quotient area, the default sort), click on a button in the Topmenu <topmenuitem>, will be below it, pop up a popmenu, Popmenu consists of two parts (above is a contentview: including: ScrollView and Subtitleimgview, bottom: Mask) #import <UIKit/UIKit.h> @interface topmenu:uiview//  for clicking on the top menu item, accommodates the created bottom pop-up menu (including a Contentview and Cover,contentview and includes ScrollView and Subtitleimgview), This member is assigned by the controller that created this topmenu, this member property is used to receive the controller's view, that is, all areas below the navigation bar, for the purpose of adding and presenting Popmenu@property (nonatomic, weak) UIView * Controllerview; @end



To be continue ...




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.