file 操作
file 操作
os
os.path.split // 分割路径和文件名
os.path.splittext // 分割文件名和文件后缀
os.path.join // 合并路径和文件名
os.rename // 移动文件或则修改文件名
os.listdir // 获取文件夹下所有文件名
Reading and Writing
open and close
f = open('workfile', 'w')
f.closed
with open('workfile') as f:
read_data = f.read()
read
f.read()
f.readline()
write
f.write()
other
f.tell() 获取当前位置
...
iOS ipa
iOS ipa
使用Apple Configurator 2下载IPA包
// IPA包保存路径
~/Library/Group Containers/K36BKF7T3D.group.com.apple.configurator/Library/Caches/Assets/TemporaryItems/MobileApps/
自定义URL Scheme
URL types
URL identifier
URL Schemes
URL Scheme跳转
配置LSApplicationQueriesSchemes, 跳转第三方URL Scheme 需要配置允许
NSURL* amapUrl = [NSURL URLWithString:@”ule...
iOS UICollectionView
iOS UICollectionView
UICollectionView
UICollectionReusableView
UICollectionViewCell
[_myCollection registerNib:[UINib nibWithNibName:@"XPDMainMyHeaderCRV" bundle:nil] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"XPDMainMyHeaderCRV"];
[_myCollection registerNib:[UINib nibWithNibName:@"XPDMainMyCell" bund...
UView Layer
UView Layer
设置圆角
// 四个角
view.layer.cornerRadius = 15;
view.layer.masksToBounds = YES; // 全部裁剪(包括子view, 包括当前view的阴影)
// 设置指定角
if (@available(iOS 11.0, *)) {
_taskCardTopV.layer.cornerRadius = 10;
_taskCardTopV.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner; } else {
UIBezierPath *pathTaskCardTopV = [UIBezie...
UIScrollView
UIScrollView
先设置约束
在Xcode 11, ScrollView 提供了Content Layout Guide 和 Frame Layout Guide, 默认打开
, 可以在Size Inspector中关闭Content Layout Guides
Content Layout Guide 和 Frame Layout Guide
Frame Layout guide: 需要设置与父视图的约束 position (x, y) and size (width, height)
Content Layout guide: 需要设置内容的大小约束
1. 拖个UIView到UIScrollView中, View到Content Layout gu...
UINavigationController 背景设置
UINavigationController 背景设置
# ios 13 前
self.navigationBar.barTintColor = C_THEME_2;//#2266EF;
self.navigationBar.backgroundColor = C_THEME_2;
self.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
self.navigationBar.tintColor = [UIColor whiteColor];
self.navigatio...
453 post articles, 57 pages.