如何獲取當前設備的系統版本!!![[[UIDevice currentDevice] systemVersion] floatValue]獲取App版本NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; // ...
如何獲取當前設備的系統版本!!!
[[[UIDevice currentDevice] systemVersion] floatValue]
獲取App版本
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
// app名稱
//NSString *app_Name = [infoDictionary objectForKey:@"CFBundleDisplayName"];
// app build版本
//NSString *app_build = [infoDictionary objectForKey:@"CFBundleVersion"];
// app版本
NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
如何更改導航控制器push動畫時間?
A控制器push到B控制器,push動畫過渡時間大約為0.3秒。希望改成0.7秒! pop出來也改成0.7秒!請問該如何實現?
- (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];
}
iOS界面設置豎屏,個別界面強制橫屏
- (BOOL)shouldAutorotate 當前viewcontroller是否支持轉屏
- (NSUInteger)supportedInterfaceOrientations;當前viewcontroller支持哪些轉屏方向 -(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation當前viewcontroller預設的屏幕方向
#import <UIKit/UIKit.h>
#import "CustomNavigationController.h" |
iOS推崇使用png格式的 說這樣不會失幀
imageWithContentsOfFile這個方法?跟imagewithname的區別嗎
imagewithname會使用系統緩存,對重覆載入的圖片速度會快。效果好
imageWithContentsOfFile不會緩存
小圖 用 imageName 大圖 還有 做動畫的圖片 使用imageWithContentsOfFile