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
9e6af874
Commit
9e6af874
authored
Sep 21, 2021
by
yuzheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复横屏下预览图片位置偏移的问题
parent
03e7c9c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletion
+7
-1
TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.m
...erController/TZImagePickerController/TZPhotoPreviewCell.m
+1
-1
TZImagePickerController/TZImagePickerController/TZPhotoPreviewController.m
...roller/TZImagePickerController/TZPhotoPreviewController.m
+3
-0
TZImagePickerController/ViewController.m
TZImagePickerController/ViewController.m
+3
-0
No files found.
TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.m
View file @
9e6af874
...
...
@@ -288,7 +288,7 @@
_imageContainerView
.
tz_width
=
width
;
_imageContainerView
.
tz_height
=
self
.
tz_height
;
_imageContainerView
.
tz_centerX
=
self
.
tz_width
/
2
;
_imageContainerView
.
tz_centerX
=
self
.
scrollView
.
tz_width
/
2
;
}
else
{
CGFloat
height
=
image
.
size
.
height
/
image
.
size
.
width
*
self
.
scrollView
.
tz_width
;
if
(
height
<
1
||
isnan
(
height
))
height
=
self
.
tz_height
;
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPreviewController.m
View file @
9e6af874
...
...
@@ -207,6 +207,9 @@
_collectionView
.
showsHorizontalScrollIndicator
=
NO
;
_collectionView
.
contentOffset
=
CGPointMake
(
0
,
0
);
_collectionView
.
contentSize
=
CGSizeMake
(
self
.
models
.
count
*
(
self
.
view
.
tz_width
+
20
),
0
);
if
(
@available
(
iOS
11
,
*
))
{
_collectionView
.
contentInsetAdjustmentBehavior
=
UIScrollViewContentInsetAdjustmentNever
;
}
[
self
.
view
addSubview
:
_collectionView
];
[
_collectionView
registerClass
:[
TZPhotoPreviewCell
class
]
forCellWithReuseIdentifier
:
@"TZPhotoPreviewCell"
];
[
_collectionView
registerClass
:[
TZVideoPreviewCell
class
]
forCellWithReuseIdentifier
:
@"TZVideoPreviewCell"
];
...
...
TZImagePickerController/ViewController.m
View file @
9e6af874
...
...
@@ -116,6 +116,9 @@
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
0
.
01
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
self
.
scrollView
.
contentSize
=
CGSizeMake
(
0
,
contentSizeH
+
5
);
});
if
(
self
.
scrollView
.
tz_height
+
80
>
self
.
view
.
tz_height
)
{
self
.
scrollView
.
tz_height
=
self
.
view
.
tz_height
-
80
;
}
_margin
=
4
;
_itemWH
=
(
self
.
view
.
tz_width
-
2
*
_margin
-
4
)
/
3
-
_margin
;
...
...
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