Is it possible to rotate only image in UIImageView? I'm looking for information about it, but i only found information how rotate UIImageVeiw.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
You can rotate the image with the following code. Note, this uses a CGImageRef which you can get from a UIImage via
Once you get the rotated image, you can set the ImageView's image to your new rotated image like this:
here is a method that will rotate the imageRef:
Please try this, it works for me:
Good luck!
The following code works fine with Swift:
If you need to rotate/flip an image for localization purposes you can use the following:
imageView.image = imageView.image?.imageFlippedForRightToLeftLayoutDirection()
Take a look at rotating the ImageView's layer. You will need to import the QuartzCore library to make that accessible.