Flip UIImageView horizontally?

Discussion in 'iOS Development' started by JoshuaCaputo, Jun 4, 2009.

  1. JoshuaCaputo

    JoshuaCaputo New Member

    Joined:
    Aug 2, 2008
    Messages:
    605
    Likes Received:
    0
    Device:
    iPod touch
    is it possible to take a UIImageView horizontally, I would assume its possible and easily.

    I would also assume its possible for any view?

    If anyone knows it would help greatly!
    ------------------double post merged------------------
    I got it

    (UIView *).layer.transform = CATransform3DMakeRotation(M_PI, 0.0f, 1.0f, 0.0f);
  2. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    That's the "hard way of doing it.
    I use a macro called degreesToRadians, which is
    #define degreesToRadians(x) (M_PI * x / 180.0)

    Later, in your actual code, just use this:
    yourUIImageView.transform = CGAffineTransformRotate(degreesToRadians(90)).

    There's no messing with the layers or anything else involved.
  3. JoshuaCaputo

    JoshuaCaputo New Member

    Joined:
    Aug 2, 2008
    Messages:
    605
    Likes Received:
    0
    Device:
    iPod touch

    Please Register or Log in to view images

    , thanks. both work. I choose your way skylar

Share This Page