iOS.Lover
iOS.Lover

Reputation: 6051

UIimageView mirroring

I am trying to do something like this :

enter image description here but can't find any post or tutorial , I would be thankful how can I turn an image to mirror like this ?

Upvotes: 1

Views: 113

Answers (2)

Roma
Roma

Reputation: 1107

here is great library on github for doing this

https://github.com/nicklockwood/ReflectionView

Upvotes: 4

Jay Gajjar
Jay Gajjar

Reputation: 2741

You can set a UIView's transform property to flip it, like so:

// this sets the view's y scale to -1, flipping it vertically
label.transform = CGAffineTransformMakeScale(1, -1);

Details about this function and others like it can be found at the CGAffineTransform reference page.

My first instinct would be to make a duplicate of whatever view you want to mirror and transform it like this.

You can also reffer

http://aptogo.co.uk/2011/08/no-fuss-reflections/ http://developer.apple.com/library/ios/#samplecode/Reflection/Introduction/Intro.html#//apple_ref/doc/uid/DTS40008063

Upvotes: 1

Related Questions