Skip to content

ContentMode not working #517

@EternalBlack

Description

@EternalBlack

I currently use Macaw 0.9.3. and cant seem to get the contentMode working (MacawView and SVGView)

Neither via storyboard, nor via code. It kinda seems like I'm missing something.

import UIKit
import Macaw

class SVGViewController: UIViewController {

    @IBOutlet weak var macaw: MacawView!
    @IBOutlet weak var svgView: SVGView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        let tiger = try! SVGParser.parse(resource: "tiger")
        self.macaw.node = tiger
        self.macaw.backgroundColor = .darkGray
        self.macaw.contentMode = .scaleToFill

        self.svgView.node = tiger
        self.svgView.backgroundColor = .darkGray
        self.svgView.contentMode = .scaleToFill
    }
}

The tiger.svg is shown on both but seems to be using .scaleAspectFit (by default I guess).

Big Scope:
What I'm actually trying to archive is masking a UIView with and SVG file. but therefor I need the SVG to .scaleToFill the other view (i.e. svgView.contentMode = .scaleToFill; svgView.frame = content.frame`; content.mask = svgView;)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions