Hi,
I'm developing a level selector for a game using swift. In my project's storyboard I added a collection view and customized the collection view's cell with an image view. After running the code, the collection view showed 4 images without focus and animations. Therefore I toggled the option "Adjusts image when focused" in IB on the imageView. After turning this feature on everything worked as expected. The selection is working, the tiles move around in "paralax"-style.
However, we are using not rectangle sized images (wings, round shapes, etc.) so that we need to use the alpha channel for leaving parts of the images transparent. Now all cells show a gray shadow. Is it possible to turn that shadow off completely? Else we have to do all animations by ourselfes.
I tried to change the shadow of the layer both of the cell and the imageView but I can't turn off the shadow and the blue selection background.
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as! TALevelGroupCollectionViewCell
// Configure the cell
let image = UIImage(named: self.world[indexPath.row])
cell.imageView.image = image
cell.highlighted = false
cell.selected = false
cell.imageView.layer.shadowColor = UIColor.yellowColor().CGColor
cell.imageView.layer.shadowRadius=10
cell.imageView.layer.shadowOffset=CGSize(width: 1, height: 1)
cell.imageView.layer.shadowOpacity=1
cell.layer.shadowColor = UIColor.yellowColor().CGColor
cell.layer.shadowRadius=10
cell.layer.shadowOffset=CGSize(width: 1, height: 1)
cell.layer.shadowOpacity=1
return cell
}The code above only adds more shadow to the images instead of turning it off or changing it. Which view or layer is rendering the shadow?
Is ist possible to use only the image transformation without a blue background for selected cells and without shadows?
Thanks in advance,
Jack