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
8ec1ee9c
Commit
8ec1ee9c
authored
Mar 20, 2019
by
yangbiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加自定义UI时选择和预览部分UI动态刷新
parent
98461cbc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
TZImagePickerController/TZImagePickerController/TZImagePickerController.h
...troller/TZImagePickerController/TZImagePickerController.h
+4
-0
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m
...troller/TZImagePickerController/TZPhotoPickerController.m
+8
-4
TZImagePickerController/TZImagePickerController/TZPhotoPreviewController.m
...roller/TZImagePickerController/TZPhotoPreviewController.m
+4
-0
No files found.
TZImagePickerController/TZImagePickerController/TZImagePickerController.h
View file @
8ec1ee9c
...
...
@@ -181,6 +181,10 @@
@property
(
nonatomic
,
copy
)
void
(
^
gifPreviewPageDidLayoutSubviewsBlock
)(
UIView
*
toolBar
,
UIButton
*
doneButton
);
@property
(
nonatomic
,
copy
)
void
(
^
assetCellDidLayoutSubviewsBlock
)(
TZAssetCell
*
cell
,
UIImageView
*
imageView
,
UIImageView
*
selectImageView
,
UILabel
*
indexLabel
,
UIView
*
bottomView
,
UILabel
*
timeLength
,
UIImageView
*
videoImgView
);
@property
(
nonatomic
,
copy
)
void
(
^
albumCellDidLayoutSubviewsBlock
)(
TZAlbumCell
*
cell
,
UIImageView
*
posterImageView
,
UILabel
*
titleLabel
);
/// 自定义各页面/组件的frame】刷新底部状态(refreshNaviBarAndBottomBarState)使用的
@property
(
nonatomic
,
copy
)
void
(
^
photoPickerPageDidRefreshStateBlock
)(
UICollectionView
*
collectionView
,
UIView
*
bottomToolBar
,
UIButton
*
previewButton
,
UIButton
*
originalPhotoButton
,
UILabel
*
originalPhotoLabel
,
UIButton
*
doneButton
,
UIImageView
*
numberImageView
,
UILabel
*
numberLabel
,
UIView
*
divideLine
);
@property
(
nonatomic
,
copy
)
void
(
^
photoPreviewPageDidRefreshStateBlock
)(
UICollectionView
*
collectionView
,
UIView
*
naviBar
,
UIButton
*
backButton
,
UIButton
*
selectButton
,
UILabel
*
indexLabel
,
UIView
*
toolBar
,
UIButton
*
originalPhotoButton
,
UILabel
*
originalPhotoLabel
,
UIButton
*
doneButton
,
UIImageView
*
numberImageView
,
UILabel
*
numberLabel
);
#pragma mark -
-
(
UIAlertController
*
)
showAlertWithTitle
:(
NSString
*
)
title
;
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m
View file @
8ec1ee9c
...
...
@@ -209,11 +209,11 @@ static CGFloat itemMargin = 5;
-
(
void
)
configBottomToolBar
{
TZImagePickerController
*
tzImagePickerVc
=
(
TZImagePickerController
*
)
self
.
navigationController
;
if
(
!
tzImagePickerVc
.
showSelectBtn
)
return
;
_bottomToolBar
=
[[
UIView
alloc
]
initWithFrame
:
CGRectZero
];
CGFloat
rgb
=
253
/
255
.
0
;
_bottomToolBar
.
backgroundColor
=
[
UIColor
colorWithRed
:
rgb
green
:
rgb
blue
:
rgb
alpha
:
1
.
0
];
_previewButton
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
[
_previewButton
addTarget
:
self
action
:
@selector
(
previewButtonClick
)
forControlEvents
:
UIControlEventTouchUpInside
];
_previewButton
.
titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
16
];
...
...
@@ -291,7 +291,7 @@ static CGFloat itemMargin = 5;
-
(
void
)
viewDidLayoutSubviews
{
[
super
viewDidLayoutSubviews
];
TZImagePickerController
*
tzImagePickerVc
=
(
TZImagePickerController
*
)
self
.
navigationController
;
CGFloat
top
=
0
;
...
...
@@ -327,7 +327,7 @@ static CGFloat itemMargin = 5;
}
_bottomToolBar
.
frame
=
CGRectMake
(
0
,
toolBarTop
,
self
.
view
.
tz_width
,
toolBarHeight
);
CGFloat
previewWidth
=
[
tzImagePickerVc
.
previewBtnTitleStr
boundingRectWithSize
:
CGSizeMake
(
CGFLOAT_MAX
,
CGFLOAT_MAX
)
options
:
NSStringDrawingUsesFontLeading
attributes
:
@{
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
16
]}
context
:
nil
].
size
.
width
+
2
;
CGFloat
previewWidth
=
[
tzImagePickerVc
.
previewBtnTitleStr
boundingRectWithSize
:
CGSizeMake
(
CGFLOAT_MAX
,
CGFLOAT_MAX
)
options
:
NSStringDrawingUsesFontLeading
attributes
:
@{
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
16
]}
context
:
nil
].
size
.
width
+
2
;
if
(
!
tzImagePickerVc
.
allowPreview
)
{
previewWidth
=
0
.
0
;
}
...
...
@@ -708,6 +708,10 @@ static CGFloat itemMargin = 5;
_originalPhotoButton
.
selected
=
(
_isSelectOriginalPhoto
&&
_originalPhotoButton
.
enabled
);
_originalPhotoLabel
.
hidden
=
(
!
_originalPhotoButton
.
isSelected
);
if
(
_isSelectOriginalPhoto
)
[
self
getSelectedPhotoBytes
];
if
(
tzImagePickerVc
.
photoPickerPageDidRefreshStateBlock
)
{
tzImagePickerVc
.
photoPickerPageDidRefreshStateBlock
(
_collectionView
,
_bottomToolBar
,
_previewButton
,
_originalPhotoButton
,
_originalPhotoLabel
,
_doneButton
,
_numberImageView
,
_numberLabel
,
_divideLine
);;
}
}
-
(
void
)
pushPhotoPrevireViewController
:(
TZPhotoPreviewController
*
)
photoPreviewVc
{
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPreviewController.m
View file @
8ec1ee9c
...
...
@@ -558,6 +558,10 @@
_originalPhotoLabel
.
hidden
=
YES
;
_doneButton
.
hidden
=
YES
;
}
if
(
_tzImagePickerVc
.
photoPreviewPageDidRefreshStateBlock
)
{
_tzImagePickerVc
.
photoPreviewPageDidRefreshStateBlock
(
_collectionView
,
_naviBar
,
_backButton
,
_selectButton
,
_indexLabel
,
_toolBar
,
_originalPhotoButton
,
_originalPhotoLabel
,
_doneButton
,
_numberImageView
,
_numberLabel
);
}
}
-
(
void
)
refreshSelectButtonImageViewContentMode
{
...
...
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