Bits of knowledge, bitsofknowledge
How to obtain the system version of the current device !!!
[[[UIDevice currentDevice] systemVersion] floatValue]
Get App version
NSDictionary * infoDictionary = [[NSBundle mainBundle] infoDictionary];
// App name
// NSString * app_Name = [infoDictionary objectForKey: @ "CFBundleDisplayName"];
// App build version
// NSString * app_build = [infoDictionary objectForKey: @ "CFBundleVersion"];
// App version
NSString * app_Version = [infoDictionary objectForKey: @ "cfbundlepolicversionstring"];
How do I change the animation push time of the navigation controller?
The transition time from Controller A to Controller B is about 0.3 seconds. Expected to change to 0.7 seconds! Pop is also changed to 0.7 seconds! How can this problem be achieved?
-(Void) pushViewController :( UIViewController *) viewController animated :( BOOL) animated
{
If (self. viewControllers. count> 0 ){
ViewController. hidesBottomBarWhenPushed = YES;
CATransition * animation = [CATransition animation];
Animation. duration = 0.5f;
Animation. timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseInEaseOut];
Animation. type = kCATransitionPush;
Animation. subtype = kCATransitionFromRight;
[Self. navigationController. view. layer addAnimation: animation forKey: nil];
[Super pushViewController: viewController animated: NO];
Return;
}
[Super pushViewController: viewController animated: YES];
}
Portrait screen is set on the iOS interface, and horizontal screen is forced on some interfaces
-(BOOL) shouldAutorotate whether the current viewcontroller supports screen Conversion
-(NSUInteger) supportedInterfaceOrientations; orientation of the current viewcontroller to be supported-(UIInterfaceOrientation) preferredInterfaceOrientationForPresentation default screen direction of the current viewcontroller
# Import <UIKit/UIKit. h>
@ Interface CustomNavigationController: UINavigationController
@ Property (nonatomic) NSUInteger orietation; # Import "mnmnavigationcontroller. h"
@ Interface CustomNavigationController ()
@ End
@ Implementation CustomNavigationController
-(Id) initWithNibName :( NSString *) nibNameOrNil bundle :( NSBundle *) nibBundleOrNil { Self = [super initWithNibName: nibNameOrNil bundle: nibBundleOrNil]; If (self ){
} Return self; }
-(Void) viewDidLoad { [Super viewDidLoad]; // Do any additional setup after loading the view. }
-(Void) didReceiveMemoryWarning { [Super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. }
// Whether the current viewcontroller supports screen Conversion -(BOOL) shouldAutorotate { Return NO;
}
// The orientation of the current viewcontroller for screen Conversion -(NSUInteger) supportedInterfaceOrientations { // Return UIInterfaceOrientationMaskLandscapeRight; Return self. orietation; }
-(BOOL) shouldAutorotateToInterfaceOrientation :( UIInterfaceOrientation) interfaceOrientation { Return (interfaceOrientation! = Self. orietation ); } |
IOS recommends using the png format to avoid Frame loss.
ImageWithContentsOfFile? Is it different from imagewithname?
Imagewithname will use the system cache, and the speed of repeatedly loading images will be faster. Good results
ImageWithContentsOfFile is not cached
The thumbnail uses imageName for the larger image and the Animated Image uses imageWithContentsOfFile.