uiscrollerviewcontroller的比例属性
minimumZoomScale和maximumZoomScale,设置最小和最大的缩放的比例,默认值都为1.0。
clipsToBounds界面边界是否修建
//设置图片属性 有可能不成比例 居左居右 填充等
imageview.contentMode = UIViewContentModeScaleAspectFit;
Vc.tabBarItem.title = title;
Vc.navigationItem.title = title;
swift 判断是否是第一次进入页面
if UserDefaults.standard.string(forKey: userDefaultKey) == "1" {
let startView: LaunchImageView = LaunchImageView.startAdsWith(imageUrl: picUrl, clickImageAction: {[weak self] in
let vc = LoadAdsWebViewViewController()
vc.title = "广告加载页面"
(self?.window?.rootViewController as! UINavigationController).pushViewController(vc, animated: true)
}) as! LaunchImageView
startView.startAnimationTime(time: 50, completionBlock: { (adsView: LaunchImageView) in
print("广告执行结束")
})
}else{
LaunchImageView.downLoadAdsImage(imageUrl: picUrl)
UserDefaults.standard.set("1", forKey: userDefaultKey)
_ = UserDefaults.standard.synchronize()
}
IOS 手机序列号 手机名称 版本等的获取
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
// app名称
NSString *app_Name = [infoDictionary objectForKey:@"CFBundleDisplayName"];
// app版本
NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
// app build版本
NSString *app_build = [infoDictionary objectForKey:@"CFBundleVersion"];
//手机序列号
NSString* identifierNumber = [[UIDevice currentDevice].identifierForVendor UUIDString];
NSLog(@"手机序列号: %@",identifierNumber);
//手机别名: 用户定义的名称
NSString* userPhoneName = [[UIDevice currentDevice] name];
NSLog(@"手机别名: %@", userPhoneName);
//设备名称
NSString* deviceName = [[UIDevice currentDevice] systemName];
NSLog(@"设备名称: %@",deviceName );
//手机系统版本
NSString* phoneVersion = [[UIDevice currentDevice] systemVersion];
NSLog(@"手机系统版本: %@", phoneVersion);
//手机型号
NSString* phoneModel = [[UIDevice currentDevice] model];
NSLog(@"手机型号: %@",phoneModel );
//地方型号 (国际化区域名称)
NSString* localPhoneModel = [[UIDevice currentDevice] localizedModel];
NSLog(@"国际化区域名称: %@",localPhoneModel );
NSDictionary *infoDictionary1 = [[NSBundle mainBundle] infoDictionary];
// 当前应用名称
NSString *appCurName = [infoDictionary1 objectForKey:@"CFBundleDisplayName"];
NSLog(@"当前应用名称:%@",appCurName);
// 当前应用软件版本 比如:1.0.1
NSString *appCurVersion = [infoDictionary1 objectForKey:@"CFBundleShortVersionString"];
NSLog(@"当前应用软件版本:%@",appCurVersion);
// 当前应用版本号码 int类型
NSString *appCurVersionNum = [infoDictionary1 objectForKey:@"CFBundleVersion"];
NSLog(@"当前应用版本号码:%@",appCurVersionNum);
imgvc 毛玻璃的效果
UIImageView *imageview = [[UIImageView alloc] init];
imageview.frame = CGRectMake(10, 100, 300, 300);
imageview.image = [UIImage imageNamed:@"2"];
//设置图片属性 有可能不成比例 居左居右 填充等
imageview.contentMode = UIViewContentModeScaleAspectFit;
imageview.userInteractionEnabled = YES;
[self.view addSubview:imageview];
UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView *effectview = [[UIVisualEffectView alloc] initWithEffect:blur];
effectview.frame = CGRectMake(0, 0, imageview.frame.size.width/2, 300);
[imageview addSubview:effectview];
向下取整
self.containerView.height = floor(image.size.height / (image.size.width / self.width));
离屏渲染
yer.masksToBounds = YES;
layer.cornerRadius = XXX;
当这两行同时使用的时候会引发离屏渲染,而离屏渲染是影响FPS一部分原因
当然这种卡顿是在页面上出现大量这种方式设置圆角的情况下,可以明显的感觉到
比如说,tableView 的cell中有很多圆角view然后 cell又是复用的,此时会卡顿到受不了的