- (void)viewDidLoad {
[super viewDidLoad];
[self.navigationController.navigationBar setBackgroundImage:xxx] forBarMetrics:UIBarMetricsDefault];
[self.navigationController.navigationBar setBarTintColor:[UIColor redColor]];
}
Run Code Online (Sandbox Code Playgroud)
在iOS14上完美运行。但在iOS15、XCode13 beta上,它不再起作用了。
为了在主屏幕小部件上实现时钟动画。我用
_clockHandRotationEffect(.custom(cycleTime), in:.current, anchor: .center)
Run Code Online (Sandbox Code Playgroud)
有替代品吗?
// viewdidload register
[self.collectionView registerClass:[TestHeaderCollectionReusableView class]
forSupplementaryViewOfKind:UICollectionElementKindSectionHeader
withReuseIdentifier:NSStringFromClass(NEHeaderCollectionReusableView.class)];
// viewForSupplementaryElementOfKind called
TestHeaderCollectionReusableView *view = [collectionView dequeueReusableSupplementaryViewOfKind:kind
withReuseIdentifier:NSStringFromClass(TestHeaderCollectionReusableView.class)
forIndexPath:indexPath];
Run Code Online (Sandbox Code Playgroud)
在 iOS15 上,插入一个项目后
- (void)insertItem {
[self.dataSourece.firstObject insertObject:@{
@"title" : @"ins1"
} atIndex:0];
NSIndexPath * path= [NSIndexPath indexPathForItem:0 inSection:0];
[self.collectionView insertItemsAtIndexPaths:@[path]];
}
Run Code Online (Sandbox Code Playgroud)
在我插入项目后,它总是会在第一次重新创建 TestHeaderCollectionReusableView 。但在 iOS14 上,它将从缓存中进行杜克。
不知道为什么。