Swift   发布时间:2022-04-30  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了如何最小化来自imageView TVOS Focus CollectionView Swift的阴影大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个UICollectionView和单元格.当我专注于细胞时,imageView会调整图像,同时重点关注细胞.我的目标是让这个影子小得多.

解决方法

在我的函数中我不使用adjusts ImageWhenAncestorFocused我手动更改图像的大小:

override func didupdateFocusInContext(context: UIFocusupdateContext,withAnimationCoordinator coordinator: UIFocusAnimationCoordinator) {
        if (self.focused)
        {


                self.imageView.frame.size.width = self.imageView.frame.width+30
                self.imageView.frame.size.height = self.imageView.frame.height+30

                self.imageView.frame.origin.x = self.imageView.frame.origin.x - 15
                self.imageView.frame.origin.y = self.imageView.frame.origin.y - 15


        else
        {

                self.imageView.frame.size.width = self.imageView.frame.width-30
                self.imageView.frame.size.height = self.imageView.frame.height-30

                self.imageView.frame.origin.x = self.imageView.frame.origin.x + 15
                self.imageView.frame.origin.y = self.imageView.frame.origin.y + 15
           }
    }

这样你就不必处理阴影了.希望这可以帮助

大佬总结

以上是大佬教程为你收集整理的如何最小化来自imageView TVOS Focus CollectionView Swift的阴影全部内容,希望文章能够帮你解决如何最小化来自imageView TVOS Focus CollectionView Swift的阴影所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。