小编hig*_*ore的帖子

导航栏 setBackgroundImage 在 iOS15 上不起作用

- (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上,它不再起作用了。

ios15

9
推荐指数
2
解决办法
5477
查看次数

Xcode14 beta(iOS 16)、SwiftUI、_clockHandRotationEffect 不再存在

为了在主屏幕小部件上实现时钟动画。我用

_clockHandRotationEffect(.custom(cycleTime), in:.current, anchor: .center)
Run Code Online (Sandbox Code Playgroud)

但在Xcode14上,它不再存在了。 在此输入图像描述

有替代品吗?

home-screen-widget swiftui ios16 xcode14

2
推荐指数
1
解决办法
1319
查看次数

iOS15 UICollectionView自定义布局,插入项目后,viewForSupplementaryElementOfKind总是重新创建一个新标题

// 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 上,它将从缓存中进行杜克。

不知道为什么。

ios uicollectionview uicollectionviewlayout ios15

1
推荐指数
1
解决办法
1504
查看次数