iOS 自定义View
iOS 自定义View
通过Xib创建View
1. NSBundle
[[NSBundle mainBundle] loadNibNamed:@"TestView" owner:self options:nil]
loadNibNamed后需要把contentView添加到当前View, View结构不会创建, 所以当前view是空的
[[NSBundle mainBundle] loadNibNamed:@"XPDTaskOperatorItemV" owner:self options:nil];
[self addSubview:_contentView];
_contentView.frame = self.bounds;
_contentView.au...
iOS Animation
iOS Animation
Reference
Human Interface Guidelines - Animation
iOS Animation Tutorial: Getting Started
Performing iOS Animations On Views With UIKit And UIView
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...
463 post articles, 58 pages.