Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem when using shadow #357

Open
KirillStaroselskiy opened this issue Feb 18, 2021 · 1 comment
Open

Problem when using shadow #357

KirillStaroselskiy opened this issue Feb 18, 2021 · 1 comment

Comments

@KirillStaroselskiy
Copy link

Hey!
I'm having a problem.
I am using drop shadow for cells in my table.
when the swipe is triggered the cell darkens, how can I fix it?

`
import UIKit
import MGSwipeTableCell

class FileTableViewCell: MGSwipeTableCell {

// MARK: - Outlets

@IBOutlet weak var containerView: UIView!{
    didSet{
        containerView.layer.masksToBounds = true

        containerView.layer.cornerRadius = 12
        containerView.layer.borderWidth = 1
        containerView.layer.borderColor = UIColor.black.withAlphaComponent(0.07).cgColor
        
    }
}

@IBOutlet weak var iconImage: UIImageView!
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var descriptionLabel: UILabel!


override func awakeFromNib() {
    super.awakeFromNib()
    backgroundColor = .clear
    contentView.backgroundColor = .clear

    layer.masksToBounds = false
    layer.shadowColor = UIColor.black.withAlphaComponent(0.07).cgColor
    layer.shadowOffset = CGSize(width: 0, height: 3)
    layer.shadowOpacity = 1
    layer.shadowRadius = 15
    
}


func fillCell(directory: Directory) {
    nameLabel.text = directory.name
    if let description =  directory.description {
        descriptionLabel.isHidden = false
        descriptionLabel.text = description
    } else {
        descriptionLabel.isHidden = true
    }
    
    iconImage.image = directory.image
}

}
`

@KirillStaroselskiy
Copy link
Author

IMG_87B64F715851-2
IMG_87B64F715851-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant