ios-baseconfig-Engineering Foundation Configuration

Source: Internet
Author: User

1> IOS Real-Machine test package path:

Click to go to folder:/applications/xcode.app/contents/developer/platforms/iphoneos.platform/devicesupport

2> Super Header file PCH configuration :Build Settings->prefix Header:$ (srcroot)/project name/class name

3>

[_filterbgview ADDSUBVIEW:_HOBBYBTN,_INTERESTBTN,_CLASSIFYBTN];//categories, interests, hobbies- (void) Filterclickevent: (uibutton*) Sender {sender.selected= !sender.selected; if(sender.selected = =YES) {         for(UIButton *buttoninchself.filterBgView.subviews) {button.selected=NO; Sender.selected=YES; }    }    if(Sender.tag = =Kclassify_tag) {        if(sender.selected) {NSLog (@"All Categories Expand"); }Else{NSLog (@"All categories Close"); }    }Else if(Sender.tag = =Kinterest_tag) {        if(sender.selected) {NSLog (@"all interests unfold"); }Else{NSLog (@"all interest closed"); }    }Else if(Sender.tag = =Khobby_tag) {        if(sender.selected) {NSLog (@"All Hobbies unfold"); }Else{NSLog (@"Smart Hobby off"); }} [self isShowTopView:sender.selected];}5. Yytext change the text to be smaller after adding pictures//Create the most important attribute textNsmutableattributedstring *contenttext =[[Nsmutableattributedstring alloc] initwithattributedstring:_momentidea.attributedtext]; Contenttext.yy_font= [Uifont systemfontofsize: +*Uiscale];self.navigationitem.title> self.title>Self.tabBarItem.title as long as the self.title is set, the Self.navigationItem.title and Self.tabBarItem.title values are consistent with self.title regardless of settings. Tabbaritem.title Settings1. TABBARVC set valid CHNAVBILLVC when creating each sub-nav controller*NAVBILLCTR =[[CHNAVBILLVC alloc] INITWITHROOTVIEWCONTROLLER:VIEWVC]; NavBillCtr.tabBarItem.title= @ "Bill";//Set Title2each sub-nav controls the Viewdidload set in the invalid Viewwillappear set valid Self.tabBarItem.title=@ "Bill 1";3Viewdidload can be set in the root controller of each sub-nav controller self.title=@ "Bill 2″self.tabbaritem.title= @ "title of Tabbar";//This setting is not validPriority level:3>2>1At the same time, the display of high priority content focus: In the root controller of each sub-nav controller self.title can control the Tabbaritem titlenavigationitem.title settings1. TABBARVC setting is invalid when creating each sub-nav controller CHNAVBILLVC*NAVBILLCTR =[[CHNAVBILLVC alloc] INITWITHROOTVIEWCONTROLLER:VIEWVC]; NavBillCtr.navigationItem.title= @ "Nav";//Invalid2each sub-nav controls the Viewdidload, viewwillappear the settings are not valid Self.navigationItem.title= @ "Bill";//are not valid3Viewdidload can be set in the root controller of each sub-nav controller self.title=@ ""; Self.navigationItem.title=@ "DSADSA"; priority: only 3 can be set, but Self.navigationItem.title>Self.title, so this priority can be done tabbaritem.title and Navigationitem.tiltle not the same display7. Setneedsdisplay and Setneedslayout, layoutsubviewslayoutsubviews: Changing the layout You can override this method in your own custom view to adjust the size and position of the sub-view. The first two methods of UIView's Setneedsdisplay and setneedslayout are executed asynchronously. Setneedsdisplay will call the automatic call DrawRect method, so that you can get uigraphicsgetcurrentcontext, you can draw. Setneedslayout will call layoutsubviews by default to handle some of the data in the child view. In summary: Setneedsdisplay convenient drawing, and layoutsubviews convenient to come out of the data setneeddisplay tell the view it has changed, need to redraw itself, is equivalent to refresh the interface. Layoutsubviews&Drawrectslayoutsubviews is called in the following cases:? 1, init initialization does not trigger layoutsubviews.? 2, Addsubview will trigger layoutsubviews.? 3, setting the frame of view will trigger Layoutsubviews, of course, if the frame value has changed before and after the setting. 4, scrolling a uiscrollview will trigger layoutsubviews.? 5, rotating screen triggers the Layoutsubviews event on the parent UIView. 6, changing the size of a uiview will also trigger the Layoutsubviews event on the parent UIView. 7, call Setlayoutsubviews directly.    DrawRect is called in the following cases:? 1, if the rect size is not set when UIView is initialized, the DrawRect is not automatically called. DrawRect is in Controller->loadview, controller->.the Viewdidload two method is then dropped. So don't worry. In the controller, these view drawrect begin to draw. This allows you to set some values in the controller to the view (if some variable values are needed for these view draw).    ? 2, the method is called after calling SizeToFit, so you can call SizeToFit to calculate the size first.    Then the system automatically calls DrawRect: method.? 3, by setting the Contentmode property value to Uiviewcontentmoderedraw.    The drawrect will be called automatically each time the frame is set or changed:.? 4, call Setneedsdisplay directly, or setneedsdisplayinrect: Trigger DrawRect: But there is a precondition that rect cannot be 0. 8. When Pop returns to the previous interface, remove the view from the navigation controller "stack" Vcnsmutablearray*a =[Nsmutablearray arrayWithArray:self.navigationController.viewControllers];  for(Uiviewcontroller *VCincha) {if([VC Iskindofclass:[xbnewloginviewcontrollerclass] ]) {[a REMOVEOBJECT:VC]; Self.navigationController.viewControllers=A;  Break; }         }9to determine whether the current interface is present or push-over Nsarray*viewcontrollers=self.navigationController.viewControllers; if(viewcontrollers.count>1) {        if([Viewcontrollers objectatindex:viewcontrollers.count-1]==Self ) {            //Push Mode[Self.navigationcontroller Popviewcontrolleranimated:yes]; }    }Else{        //present Way[Self.navigationcontroller Dismissviewcontrolleranimated:yes Completion:nil]; }9How to make the CollectionView move the Set setcontentoffset overallif(option==xbmemberexchangecodereceivenotistate) {[_collectionview Setcontentoffset:cgpointmake (0, + -*Suitscale) Animated:yes]; }Else if(option==xbmemberexchangecodedisappearstate) {[_collectionview Setcontentoffset:cgpointmake (0, - -*Suitscale) Animated:yes]; }

ios-baseconfig-Engineering Foundation Configuration

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.