星空网 > 软件开发 > 操作系统

Bits of knowledge

如何获取当前设备的系统版本!!! 
[[[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>

@interface CustomNavigationController : UINavigationController

@property(nonatomic)NSUInteger orietation; 

 

 

#import "CustomNavigationController.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.
}

//当前viewcontroller是否支持转屏
-(BOOL)shouldAutorotate
{
    return NO;
    
}

//当前viewcontroller支持哪些转屏方向
-(NSUInteger)supportedInterfaceOrientations{
    //return UIInterfaceOrientationMaskLandscapeRight;
    return self.orietation;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation != self.orietation);

 

iOS推崇使用png格式的 说这样不会失帧
imageWithContentsOfFile这个方法?跟imagewithname的区别吗
imagewithname会使用系统缓存,对重复加载的图片速度会快。效果好 
imageWithContentsOfFile不会缓存



小图 用 imageName  大图 还有 做动画的图片 使用imageWithContentsOfFile



原标题:Bits of knowledge

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

塑料制品:https://www.goluckyvip.com/tag/11492.html
限制发货:https://www.goluckyvip.com/tag/11493.html
FBA新规:https://www.goluckyvip.com/tag/11494.html
FBA入库:https://www.goluckyvip.com/tag/11495.html
宠物市场:https://www.goluckyvip.com/tag/11496.html
股权激励计划:https://www.goluckyvip.com/tag/11497.html
三亚有哪些酒店值得入住?:https://www.vstour.cn/a/366173.html
零售晚报:丽人丽妆2023年扭亏为盈 玉容初、美壹堂等自有品牌增速超40% :https://www.kjdsnews.com/a/1836649.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流