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
0a4ee696
Commit
0a4ee696
authored
Jun 03, 2017
by
yuzheng.tz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化全景图片的选择体验,增加清晰度和最大可放大比例
parent
570eedc8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
TZImagePickerController/TZImagePickerController/TZImageManager.m
...PickerController/TZImagePickerController/TZImageManager.m
+5
-1
TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.m
...erController/TZImagePickerController/TZPhotoPreviewCell.m
+10
-1
No files found.
TZImagePickerController/TZImagePickerController/TZImageManager.m
View file @
0a4ee696
...
@@ -417,7 +417,11 @@ static CGFloat TZScreenScale;
...
@@ -417,7 +417,11 @@ static CGFloat TZScreenScale;
}
else
{
}
else
{
PHAsset
*
phAsset
=
(
PHAsset
*
)
asset
;
PHAsset
*
phAsset
=
(
PHAsset
*
)
asset
;
CGFloat
aspectRatio
=
phAsset
.
pixelWidth
/
(
CGFloat
)
phAsset
.
pixelHeight
;
CGFloat
aspectRatio
=
phAsset
.
pixelWidth
/
(
CGFloat
)
phAsset
.
pixelHeight
;
CGFloat
pixelWidth
=
photoWidth
*
TZScreenScale
;
CGFloat
pixelWidth
=
photoWidth
*
TZScreenScale
*
1
.
5
;
// 优化超宽图片的显示
if
(
aspectRatio
>
1
)
{
pixelWidth
=
pixelWidth
*
aspectRatio
;
}
CGFloat
pixelHeight
=
pixelWidth
/
aspectRatio
;
CGFloat
pixelHeight
=
pixelWidth
/
aspectRatio
;
imageSize
=
CGSizeMake
(
pixelWidth
,
pixelHeight
);
imageSize
=
CGSizeMake
(
pixelWidth
,
pixelHeight
);
}
}
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.m
View file @
0a4ee696
...
@@ -79,7 +79,7 @@
...
@@ -79,7 +79,7 @@
_scrollView
.
delegate
=
self
;
_scrollView
.
delegate
=
self
;
_scrollView
.
scrollsToTop
=
NO
;
_scrollView
.
scrollsToTop
=
NO
;
_scrollView
.
showsHorizontalScrollIndicator
=
NO
;
_scrollView
.
showsHorizontalScrollIndicator
=
NO
;
_scrollView
.
showsVerticalScrollIndicator
=
NO
;
_scrollView
.
showsVerticalScrollIndicator
=
YES
;
_scrollView
.
autoresizingMask
=
UIViewAutoresizingFlexibleWidth
|
UIViewAutoresizingFlexibleHeight
;
_scrollView
.
autoresizingMask
=
UIViewAutoresizingFlexibleWidth
|
UIViewAutoresizingFlexibleHeight
;
_scrollView
.
delaysContentTouches
=
NO
;
_scrollView
.
delaysContentTouches
=
NO
;
_scrollView
.
canCancelContentTouches
=
YES
;
_scrollView
.
canCancelContentTouches
=
YES
;
...
@@ -197,6 +197,15 @@
...
@@ -197,6 +197,15 @@
-
(
void
)
setAllowCrop
:(
BOOL
)
allowCrop
{
-
(
void
)
setAllowCrop
:(
BOOL
)
allowCrop
{
_allowCrop
=
allowCrop
;
_allowCrop
=
allowCrop
;
_scrollView
.
maximumZoomScale
=
allowCrop
?
4
.
0
:
2
.
5
;
_scrollView
.
maximumZoomScale
=
allowCrop
?
4
.
0
:
2
.
5
;
if
([
self
.
asset
isKindOfClass
:[
PHAsset
class
]])
{
PHAsset
*
phAsset
=
(
PHAsset
*
)
self
.
asset
;
CGFloat
aspectRatio
=
phAsset
.
pixelWidth
/
(
CGFloat
)
phAsset
.
pixelHeight
;
// 优化超宽图片的显示
if
(
aspectRatio
>
1
.
5
)
{
self
.
scrollView
.
maximumZoomScale
*=
aspectRatio
/
1
.
5
;
}
}
}
}
-
(
void
)
refreshScrollViewContentSize
{
-
(
void
)
refreshScrollViewContentSize
{
...
...
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