Invalide the invalidateIntrinsicContentSize to trigger update

This commit is contained in:
DreamPiggy 2019-11-10 05:33:34 +08:00
parent e01fa4047b
commit 28dbd8e459
3 changed files with 8 additions and 0 deletions

View File

@ -427,6 +427,8 @@ public struct AnimatedImage : PlatformViewRepresentable {
// Antialiased
view.shouldAntialias = self.antialiased
#endif
view.invalidateIntrinsicContentSize()
}
func configureView(_ view: AnimatedImageViewWrapper, context: Context) {

View File

@ -19,6 +19,8 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)init WK_AVAILABLE_WATCHOS_ONLY(6.0);
- (void)invalidateIntrinsicContentSize;
@end
NS_ASSUME_NONNULL_END

View File

@ -194,6 +194,10 @@ static CGSize sizeThatFitsIMP(id<UIViewProtocol> self, SEL _cmd, CGSize size) {
self.wrapped._interfaceView = interfaceView.subviews.firstObject;
}
- (void)invalidateIntrinsicContentSize {
[self._interfaceView invalidateIntrinsicContentSize];
}
@end
#endif