I am using iconic font (http://zavoloklom.github.io/material-design-iconic-font/cheatsheet.html) and I am using the reply button as a button title. I was wondering how to reflect the button's title vertically. I found a lot of resources on rotating the button image (Objective C: How can you rotate text for UIButton and UILabel?), HOWEVER, I want to REFLECT, not rotate. Rotating the image 180 degrees makes the arrow upside down.
Asked
Active
Viewed 97 times
1 Answers
3
Set a scale transform of -100% for the axis you want to flip on. You may also need to adjust the frame slightly to get the effect you want, depending on if your arrow is "on" the reflecting surface or if you want a gap.
[self.myButton.titleLabel setTransform:CGAffineTransformMakeScale(1, -1)];

Chris Slowik
- 2,859
- 1
- 14
- 27
-
That didnt work... I am using a button title. Would that make a difference? – Josh O'Connor Sep 25 '15 at 17:26
-
Just tested it and it worked for me. Do you get an error or just no effect? – Chris Slowik Sep 25 '15 at 17:38
-
Could you post some code examples in your original post? Add what you've tried etc. Here's what it looks like when I did it: http://prntscr.com/8kee4l (i edited my answer to be more button-oriented) – Chris Slowik Sep 25 '15 at 18:04
-
1Actually I just re-did it. I accidently had the wrong button outlet attached to it. Worked.. Thank you! – Josh O'Connor Sep 25 '15 at 18:19