ios - Rotate an image on iPhone only? -


how 1 rotate image using following line of code iphone only?

photoview.transform=cgaffinetransformmakerotation(m_pi*0.5); 

my app uses uiscrollview. in scrollview thumbnail images. when thumbnail tapped, segue triggered load image in new view controller, reason, image loads on side on iphone 4 (it loads straight on ipad mini)

i used following if statement format no avail...

 if ([[uiscreen mainscreen] bounds].size.height == 480)     {         // iphone, ipod touch      ...     } 

my question: there way explicitly rotate image on iphone devices only? following line rotates image correctly iphone uses, conversely erroneously loads ipad.

photoview.transform=cgaffinetransformmakerotation(m_pi*0.5); 

how can 1 programmatically rotate image iphone 4 only? additional info: technically iphone app under build settings.

try this

if ([[uidevice currentdevice] userinterfaceidiom] == uiuserinterfaceidiompad){ } if ([[uidevice currentdevice] userinterfaceidiom] == uiuserinterfaceidiomphone){ } 

hope helps.


Comments