Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
dz_TZImagePickerController
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shuijing
dz_TZImagePickerController
Commits
3a7d7262
Commit
3a7d7262
authored
May 29, 2019
by
yuzheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化scaleAspectFillCrop配置的细节
parent
4ee54c2b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
10 deletions
+15
-10
TZImagePickerController.xcodeproj/project.pbxproj
TZImagePickerController.xcodeproj/project.pbxproj
+6
-5
TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.m
...erController/TZImagePickerController/TZPhotoPreviewCell.m
+8
-5
TZImagePickerController/ViewController.m
TZImagePickerController/ViewController.m
+1
-0
No files found.
TZImagePickerController.xcodeproj/project.pbxproj
View file @
3a7d7262
...
@@ -487,7 +487,7 @@
...
@@ -487,7 +487,7 @@
TargetAttributes
=
{
TargetAttributes
=
{
900E657B1C2BB8D5003D9A9E
=
{
900E657B1C2BB8D5003D9A9E
=
{
CreatedOnToolsVersion
=
7.2
;
CreatedOnToolsVersion
=
7.2
;
DevelopmentTeam
=
T86X98NCU2
;
DevelopmentTeam
=
LTFQDC2QVX
;
ProvisioningStyle
=
Automatic
;
ProvisioningStyle
=
Automatic
;
};
};
900E65941C2BB8D5003D9A9E
=
{
900E65941C2BB8D5003D9A9E
=
{
...
@@ -510,6 +510,7 @@
...
@@ -510,6 +510,7 @@
developmentRegion
=
English
;
developmentRegion
=
English
;
hasScannedForEncodings
=
0
;
hasScannedForEncodings
=
0
;
knownRegions
=
(
knownRegions
=
(
English
,
en
,
en
,
Base
,
Base
,
"zh-Hans"
,
"zh-Hans"
,
...
@@ -799,7 +800,7 @@
...
@@ -799,7 +800,7 @@
CODE_SIGN_IDENTITY
=
""
;
CODE_SIGN_IDENTITY
=
""
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
DEVELOPMENT_TEAM
=
T86X98NCU2
;
DEVELOPMENT_TEAM
=
LTFQDC2QVX
;
FRAMEWORK_SEARCH_PATHS
=
(
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(inherited)"
,
"$(PROJECT_DIR)/TZImagePickerController"
,
"$(PROJECT_DIR)/TZImagePickerController"
,
...
@@ -807,7 +808,7 @@
...
@@ -807,7 +808,7 @@
INFOPLIST_FILE
=
TZImagePickerController/Info.plist
;
INFOPLIST_FILE
=
TZImagePickerController/Info.plist
;
IPHONEOS_DEPLOYMENT_TARGET
=
8.0
;
IPHONEOS_DEPLOYMENT_TARGET
=
8.0
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
PRODUCT_BUNDLE_IDENTIFIER
=
tanzhen.TZImagePickerController.www
;
PRODUCT_BUNDLE_IDENTIFIER
=
tanzhen
ios
.TZImagePickerController.www
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PROVISIONING_PROFILE
=
""
;
PROVISIONING_PROFILE
=
""
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
...
@@ -822,7 +823,7 @@
...
@@ -822,7 +823,7 @@
CODE_SIGN_IDENTITY
=
""
;
CODE_SIGN_IDENTITY
=
""
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone Developer"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
DEVELOPMENT_TEAM
=
T86X98NCU2
;
DEVELOPMENT_TEAM
=
LTFQDC2QVX
;
FRAMEWORK_SEARCH_PATHS
=
(
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(inherited)"
,
"$(PROJECT_DIR)/TZImagePickerController"
,
"$(PROJECT_DIR)/TZImagePickerController"
,
...
@@ -830,7 +831,7 @@
...
@@ -830,7 +831,7 @@
INFOPLIST_FILE
=
TZImagePickerController/Info.plist
;
INFOPLIST_FILE
=
TZImagePickerController/Info.plist
;
IPHONEOS_DEPLOYMENT_TARGET
=
8.0
;
IPHONEOS_DEPLOYMENT_TARGET
=
8.0
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
LD_RUNPATH_SEARCH_PATHS
=
"$(inherited) @executable_path/Frameworks"
;
PRODUCT_BUNDLE_IDENTIFIER
=
tanzhen.TZImagePickerController.www
;
PRODUCT_BUNDLE_IDENTIFIER
=
tanzhen
ios
.TZImagePickerController.www
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PROVISIONING_PROFILE
=
""
;
PROVISIONING_PROFILE
=
""
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.m
View file @
3a7d7262
...
@@ -206,12 +206,15 @@
...
@@ -206,12 +206,15 @@
self
.
imageRequestID
=
[[
TZImageManager
manager
]
getPhotoWithAsset
:
asset
completion
:
^
(
UIImage
*
photo
,
NSDictionary
*
info
,
BOOL
isDegraded
)
{
self
.
imageRequestID
=
[[
TZImageManager
manager
]
getPhotoWithAsset
:
asset
completion
:
^
(
UIImage
*
photo
,
NSDictionary
*
info
,
BOOL
isDegraded
)
{
if
(
!
[
asset
isEqual
:
self
->
_asset
])
return
;
if
(
!
[
asset
isEqual
:
self
->
_asset
])
return
;
self
.
imageView
.
image
=
photo
;
self
.
imageView
.
image
=
photo
;
CGFloat
scale
=
MAX
(
self
.
cropRect
.
size
.
width
/
self
.
imageView
.
tz_width
,
self
.
cropRect
.
size
.
height
/
self
.
imageView
.
tz_height
);
[
self
resizeSubviews
];
[
self
resizeSubviews
];
if
(
self
.
scaleAspectFillCrop
&&
scale
>
1
)
{
// 如果设置图片缩放裁剪并且图片需要缩放
if
(
self
.
imageView
.
tz_height
&&
self
.
allowCrop
)
{
self
.
scrollView
.
minimumZoomScale
=
scale
;
CGFloat
scale
=
MAX
(
self
.
cropRect
.
size
.
width
/
self
.
imageView
.
tz_width
,
self
.
cropRect
.
size
.
height
/
self
.
imageView
.
tz_height
);
self
.
scrollView
.
maximumZoomScale
=
scale
*
2
;
if
(
self
.
scaleAspectFillCrop
&&
scale
>
1
)
{
// 如果设置图片缩放裁剪并且图片需要缩放
[
self
.
scrollView
setZoomScale
:
scale
animated
:
YES
];
CGFloat
multiple
=
self
.
scrollView
.
maximumZoomScale
/
self
.
scrollView
.
minimumZoomScale
;
self
.
scrollView
.
minimumZoomScale
=
scale
;
self
.
scrollView
.
maximumZoomScale
=
scale
*
MAX
(
multiple
,
2
);
[
self
.
scrollView
setZoomScale
:
scale
animated
:
YES
];
}
}
}
self
->
_progressView
.
hidden
=
YES
;
self
->
_progressView
.
hidden
=
YES
;
...
...
TZImagePickerController/ViewController.m
View file @
3a7d7262
...
@@ -321,6 +321,7 @@
...
@@ -321,6 +321,7 @@
NSInteger
widthHeight
=
self
.
view
.
tz_width
-
2
*
left
;
NSInteger
widthHeight
=
self
.
view
.
tz_width
-
2
*
left
;
NSInteger
top
=
(
self
.
view
.
tz_height
-
widthHeight
)
/
2
;
NSInteger
top
=
(
self
.
view
.
tz_height
-
widthHeight
)
/
2
;
imagePickerVc
.
cropRect
=
CGRectMake
(
left
,
top
,
widthHeight
,
widthHeight
);
imagePickerVc
.
cropRect
=
CGRectMake
(
left
,
top
,
widthHeight
,
widthHeight
);
imagePickerVc
.
scaleAspectFillCrop
=
YES
;
// 设置横屏下的裁剪尺寸
// 设置横屏下的裁剪尺寸
// imagePickerVc.cropRectLandscape = CGRectMake((self.view.tz_height - widthHeight) / 2, left, widthHeight, widthHeight);
// imagePickerVc.cropRectLandscape = CGRectMake((self.view.tz_height - widthHeight) / 2, left, widthHeight, widthHeight);
/*
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment