خرید بک لینک

Vote count: 0

I'm trying to cut a hole inside UICollectionView. It works - but for some reason it cut's the UICollectionViewbehind the contentcells. I'm trying to cut it including the contentcells.

Sample :

enter image description here

Code:

class tCollection : UICollectionView
{
    override func drawRect(rect: CGRect) {
        super.drawRect(rect)
        let  holeRect = CGRectMake(20, 20, 50, 60)
        var context: CGContextRef = UIGraphicsGetCurrentContext()!
        CGContextSetFillColorWithColor(context, UIColor.blackColor().colorWithAlphaComponent(0.5).CGColor)
        CGContextFillRect(context, rect)
        var holeRectIntersection: CGRect = CGRectIntersection(holeRect, rect)
        CGContextSetFillColorWithColor(context, UIColor.clearColor().CGColor)
        CGContextSetBlendMode(context, CGBlendMode.Clear)
        CGContextFillEllipseInRect(context, holeRect)


    }
}

Any suggestion how to cut a hole completeley(including the cells/subviews etc')

asked 53 secs ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 27 اسفند 1394 ساعت: 0:19

صفحه بندی