2015-12-13 4 views
5

私はUICollectionViewとそれに細胞を持っています。私がセルに焦点を当てると、imageView adjustsImageWhenAncestorFocused。私の目標は、この影をもっと小さくすることです。私の機能でimageViewから影を最小限に抑える方法TVOS Focus CollectionView Swift

+1

あなたはまだ解決策を見つけましたか?同じ問題で苦労しているATM – Steaphann

+1

@Steaphannいいえ、もし私が見つけたらplsを書いてください – HadevsCode

+0

@Steaphannはちょうど解決策を提出しました –

答えて

0

私は手動で画像のサイズを変更するadjustsImageWhenAncestorFocusedを使用しないでください:

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 
      } 
    } 

あなたが影に対処する必要はありません。この道を。これがうまくいきたいです

関連する問題