In my app, I am taking picture with camera and displaying it in 320*320 UIView
. But as the image resolution is more than that of UIView
its kinda look squeezed. Is there any way I can resize that image?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- SwiftUI: UIImage (QRCode) does not load after call
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Attempt to present UIAlertController on View Contr
I do this, but first I enable the photo picker to editable so it is default 1:1 aspect, like so:
then I resize the image using this method:
Here's how you can resize the image while preserving its aspect ratio. The code below is from a category for
UIImage
: