1
所以,我有以下功能的iOS更新的CALayer
- (void)setMoreMenuHidden:(BOOL)hidden animated:(BOOL)animated completion:(void(^)(BOOL))completion
{
if (!hidden)
{
[self.view layoutIfNeeded];
[self.view setNeedsUpdateConstraints];
[UIView animateWithDuration:0.5f animations:^
{
[self.view layoutIfNeeded];
[_profileInfoVC viewWillLayoutSubviews];
}];
}
}
和內_profileInfoVC
我把它做
-(void)viewWillLayoutSubviews
{
[super viewWillLayoutSubviews];
[self.view layoutIfNeeded];
self.pictureImageView.layer.cornerRadius = self.pictureImageView.frame.size.width/2;
self.pictureImageView.clipsToBounds = YES;
}
所以我知道層動畫塊中忽略,但我認爲這也意味着更新,因爲在動畫期間和之後它仍然是相當正方形的。有沒有解決方案,這不需要我也爲圖層創建一個核心動畫?