Macaw icon indicating copy to clipboard operation
Macaw copied to clipboard

Multiple SVGs not rendering

Open Muhammad-AhmadRafique opened this issue 6 years ago • 9 comments

Multiple svgs not loading on latest version 0.9.4. It is working fine on previous 0.9.2 version. Basically, I am using multiple views with same size in a single viewController and rendering different SVG files on all the views. It is working fine on 0.9.2 version, but now it is not working properly. It is only showing the top most View, not showing all the views. Does anyone know what's wrong here ?

Regards,

Muhammad-AhmadRafique avatar Feb 20 '19 09:02 Muhammad-AhmadRafique

Hi Muhammad,

Do you have a sample we can use to reproduce this issue?

ystrot avatar Feb 20 '19 09:02 ystrot

Can I send screenshots? Will it help ? Or anything you want to send me?

Muhammad-AhmadRafique avatar Feb 20 '19 10:02 Muhammad-AhmadRafique

If you can create a sample project which we can run and see it doesn't work - it would be perfect.

ystrot avatar Feb 20 '19 10:02 ystrot

@ystrot , I have attached my sample project, I am using version 0.9.2, which is working fine, and rendering all svg files. But when I upgraded to 0.9.4, it does not render all svgs, You can check it by upgrading pod to 0.9.4

Please let me know, if you need me. Thanks,

Regards, Sample.zip

Muhammad-AhmadRafique avatar Feb 20 '19 11:02 Muhammad-AhmadRafique

Hi @ystrot , Did the sample project help you to find the issue?

Muhammad-AhmadRafique avatar Feb 21 '19 05:02 Muhammad-AhmadRafique

Hi @Muhammad-AhmadRafique,

Can't run your project because doberman_body_one.svg file is missed.

ystrot avatar Feb 22 '19 07:02 ystrot

oh sorry @ystrot , I missed it, Please check it now, I have attached the file. sample.zip

Muhammad-AhmadRafique avatar Feb 22 '19 10:02 Muhammad-AhmadRafique

This issue appears because we changed default view color from transparent to white. I'm not sure why background colors which you set in the storyboard don't work, will check it later. However for now you can make your views transparent in the controller:

class ViewController: UIViewController {

    @IBOutlet weak var tail: SVGView!
    @IBOutlet weak var body: SVGView!
    @IBOutlet weak var ears: SVGView!
    @IBOutlet weak var face: SVGView!
    @IBOutlet weak var nose: SVGView!
    @IBOutlet weak var eyes: SVGView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        tail.backgroundColor = nil
        body.backgroundColor = nil
        ears.backgroundColor = nil
        face.backgroundColor = nil
        nose.backgroundColor = nil
        eyes.backgroundColor = nil
    }
}

ystrot avatar Feb 22 '19 14:02 ystrot

@ystrot , Thanks for the solution. Yes, it is working fine by setting background colours through code. And it is ok, You can check it what is wrong through storyboard. Thanks for your help.

Kind Regards, Mohammad Ahmad

Muhammad-AhmadRafique avatar Feb 25 '19 04:02 Muhammad-AhmadRafique