Label View Controller-UitabbarcontrollerCustom UitabbaritemCustomize the navigation bar and tab bar background pictureintegrated use of three view controllers
I. Tag View controller UitabbarcontrollerUitabbarcontroller has the following important propertiesViewcontrollers The View controller displayedtabBar Tab BarDelegate Protocol
TabBar is a Uitabbar object that contains multiple Uitabbaritem, one viewcontroller for each tanbaritem. Tabbar Height for
When more than five Tabbaritem, the system will automatically add a more button, click More buttons, not at the bottom of those buttons will appear in a list
UiappearanceIf you want to set all the Navigation view controller color by one button, similar to QQ one-button skin-changing operation, can be operated through the Uiappearance protocol, through which you can customize the color of some controls, etc.
Uitabbarcontroller * tab = [[Uitabbarcontroller alloc] init]; Tab.delegate = self; [Tab SETHIDESBOTTOMBARWHENPUSHED:NO]; Nsarray * arr = [Nsarray arraywithobjects:nav,nav2,nav3,nav4,nav5,nav6, nil]; [Tab Setviewcontrollers:arr]; The color of the whole strip [Tab.tabbar Setbartintcolor:[uicolor whitecolor]; Color of each icon [Tab.tabbar settintcolor:[uicolor Orangecolor];
SummaryUitabbarcontroller is a common layout style in project development, and unlike Uinavigationcontroller, its viewcontroller are tied, And the Uinavigationcontroller is hierarchical.
Uitabbatcontroller,uinavigationcontroller and Uitableviewcontroller, usually a combination, this layout is particularly common, it must be skilled application
Uitabbarcontroller can be nested Uinavigationcontroller
Uinavigationcontroller can also be nested Uitabbatcontroller
IOS block Usagein iOS, the definition uses "^" to indicate the block variable, the content is contained in "{}", and as in the C language, with "; "To represent the end of the statement
int multiplier = 7;
Int (^myblock) (int) = ^ (int num) {return num * multiplier;};
"^" declares that this is a block, "Myblock" is the variable name
Block return value type int typeparameters of type intparameter is named "num"
No return type no parameter type block-(void) testfirstblock{void (^myblock) () = ^ () {NSLog (@ "I lost >3<"); }; NSLog (@ "who goes First"); Myblock ();} -(void) testsecondblock{void (^twoblock) (NSString *) = ^ (NSString * str) {NSLOG (@ "str = =%@", str); }; Twoblock (@ "Walk with Hand"); Twoblock (@ "pig dots");} No return value multiple parameters-(void) testthirdblock{void (^thirdblock) (nsstring *,int) = ^ (NSString * Str,int a) {NSLog (@ "int = =% D,str = =%@ ", a,str); }; Thirdblock (@ "(?????)", 55555);} There are return values with parameters-(void) testforthblock{int (^forthblock) (nsstring *,nsinteger) = ^ (NSString * Value,nsinteger num) { int strvalue = [value intvalue]; return strvalue+num; }; int d = forthblock (@ "77", 2); NSLog (@ "(?????) A = =%d ", d);} Change background color-(void) testcolorblock{void (^myblock) (Uicolor *) = ^ (Uicolor * color) {[Self.view Setbackgroundcolor:co LOR]; }; Self.teseblock = Myblock; NSLog (@ "TextBlock = =%@", self.teseblock);}
Block Considerationssince the variables created by block are divided into two memory regions, the global and the stack, it is necessary to copy the block's member variables or attributes into the heap memory in iOS if they are used.