- StatusBar Moving Position
NSString *key = [[NSString alloc] initwithdata:[nsdata datawithbytes: (unsignedChar[]){0x73,0x74,0x61,0x74,0x75,0x73,0x42,0x61,0x72} Length:9] encoding:nsasciistringencoding]; Key=@"StatusBar";//the same effect ID Object=[UIApplication sharedapplication]; UIView*StatusBar; if([Objectrespondstoselector:nsselectorfromstring (key)]) {StatusBar= [ObjectValueforkey:key]; } statusbar.transform= Cgaffinetransformmaketranslation (self.paneview.frame.origin.x, SELF.PANEVIEW.FRAME.ORIGIN.Y);
- TabBar Custom Icons
if(Floor (Nsfoundationversionnumber) >Nsfoundationversionnumber_ios_6_1) {UIImage*icon = [[UIImage imagenamed:@"jinghua-selected"] imagewithrenderingmode:uiimagerenderingmodealwaysoriginal]; UIImage*unicon = [[UIImage imagenamed:@"Jinghua"] imagewithrenderingmode:uiimagerenderingmodealwaysoriginal]; [Nc.tabbaritem Setfinishedselectedimage:icon Withfinishedunselectedimage:unicon]; } Else{[Nc.tabbaritem setfinishedselectedimage:[uiimage imagenamed:@"jinghua-selected"] Withfinishedunselectedimage:[uiimage imagenamed:@"Jinghua"]]; } [Nc.tabbaritem settitle:nslocalizedstring (@"Essence", nil)];
- Tabbaritem Custom Colors
[[Uitabbaritem appearance] Settitletextattributes:[nsdictionary Dictionarywithobjectsandkeys: [Uicolor colorwithwhite:113./255Alpha1], Uitextattributetextcolor, nil] forstate:uicontrolstatenormal]; //item Check state color[[Uitabbaritem appearance] Settitletextattributes:[nsdictionary Dictionarywithobjectsandkeys: [Uicolor colorwithwhite: About./255Alpha1], Uitextattributetextcolor, nil] forstate:uicontrolstateselected];
- Expand the hit area
#import<objc/runtime.h>@implementationUicontrol (userinteractoinedgeinsets)Static CharTopnamekey;Static CharRightnamekey;Static CharBottomnamekey;Static CharLeftnamekey;-(void) Setuserinteractionedgeinsets: (uiedgeinsets) edgeinsets{objc_setassociatedobject (self,&Topnamekey, [NSNumber numberWithFloat:edgeInsets.top], objc_association_copy_nonatomic); Objc_setassociatedobject (Self,&Rightnamekey, [NSNumber numberWithFloat:edgeInsets.right], objc_association_copy_nonatomic); Objc_setassociatedobject (Self,&Bottomnamekey, [NSNumber NumberWithFloat:edgeInsets.bottom], objc_association_copy_nonatomic); Objc_setassociatedobject (Self,&Leftnamekey, [NSNumber NumberWithFloat:edgeInsets.left], objc_association_copy_nonatomic);}-(cgrect) enlargedrect{NSNumber* TopEdge = Objc_getassociatedobject (self, &Topnamekey); NSNumber* Rightedge = Objc_getassociatedobject (self, &Rightnamekey); NSNumber* Bottomedge = Objc_getassociatedobject (self, &Bottomnamekey); NSNumber* Leftedge = Objc_getassociatedobject (self, &Leftnamekey); if(TopEdge && rightedge && bottomedge &&Leftedge) { returnCGRectMake (Self.bounds.origin.x-Leftedge.floatvalue, Self.bounds.origin.y-Topedge.floatvalue, Self.bounds.size.width+ Leftedge.floatvalue +Rightedge.floatvalue, Self.bounds.size.height+ Topedge.floatvalue +bottomedge.floatvalue); } Else { returnSelf.bounds; }}-(uiview*) HitTest: (cgpoint) point withevent: (uievent*)Event{cgrect rect=[self enlargedrect]; if(Cgrectequaltorect (rect, self.bounds)) {return[Super Hittest:point Withevent:Event]; } returnCgrectcontainspoint (rect, point)?Self:nil;}@end
- Tabbarcontroller adding deletes dynamically
@implementationuitabbarcontroller (Dynamic)-(void) Deletechildviewcontroller: (uiviewcontroller*) controller{if([self.viewcontrollers Containsobject:controller]) {Nsmutablearray*viewcontrollers =[Nsmutablearray arrayWithArray:self.viewControllers]; [Viewcontrollers Removeobject:controller]; Self.viewcontrollers=[Nsarray arraywitharray:viewcontrollers]; }}-(void) Insertchildviewcontroller: (uiviewcontroller*Controller atindex: (nsinteger) index{if(Index >=0&& Index <=self.viewcontrollers.count &&![Self.viewcontrollers Containsobject:controller]) {Nsmutablearray*viewcontrollers =[Nsmutablearray arrayWithArray:self.viewControllers]; if(!viewcontrollers) {Viewcontrollers=[Nsmutablearray array]; } [Viewcontrollers Insertobject:controller atindex:index]; Self.viewcontrollers=[Nsarray arraywitharray:viewcontrollers]; }}@end
- Navigationbar Custom
[ [Uinavigationbar appearance] settitletextattributes:[nsdictionary dictionarywithobjectsandkeys: [UIColor Whitecolor], Uitextattributetextcolor, nil]]; if([[Uidevice currentdevice].systemversion floatvalue]<7.0) {[Self.navigationbar settintcolor:[uicolor colorwithred:0.0Green194./255Blue196./255Alpha1]]; }Else{[Self.navigationbar setbartintcolor:[uicolor colorwithred:0.0Green194./255Blue196./255Alpha1]]; }
- Local language modifications
[[Nsuserdefaults standarduserdefaults] Setobject:[nsarray arraywithobjects:language, nil] ForKey: @ "applelanguages"]; [[Nsuserdefaults standarduserdefaults] synchronize];
- 2
- 2
- 2
- 2
- 22
- 2
- 2
- 2
- 22
- 333
- 3
- 33
- 3
- 3
- 3333
- 3
- 3