Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 03-03-2011, 08:36 PM   #1 (permalink)
Registered Member
 
Join Date: Mar 2011
Posts: 35
Kenenth is on a distinguished road
Default How to set a rotation point for a UIImageView help?

I am creating an app in witch a big part of the game is being able to rotate a UIImageview that is a gun barrel. It is rotated by the user interacting with the slider. The slider value is from -.50 to .50. I multiply the slider value by 180 to get the degrees (from 0 to 180 degrees) and then rotate my image based on that value. But, the Image is only being rotated around the center, like this:
|
* <-- rotation point
|

But i need the rotation point to be on the bottom, like this:


|
|
|
* <-- rotation point



Please tell me how I can set the rotation point. Im 12 so try to keep it simple. Thanks!
Kenenth is offline   Reply With Quote
Old 03-03-2011, 10:30 PM   #2 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 140
MatthewD is on a distinguished road
Default

Check out the anchorPoint property for the view's layer.

view.layer.anchorPoint = CGPointMake(0.5f, 1.0f);
MatthewD is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone, rotation point, slider, uiimageview, xcode

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 371
16 members and 355 guests
Absentia, akphyo, apatsufas, BinHex, dre, Error404, Gaz, gmarro, jeroenkeij, Kirkout, MarkC, mottdog, Music Man, PavelMik, whitey99, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,666
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, cpsclicker
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:20 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0