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
8b226a68
Commit
8b226a68
authored
May 19, 2018
by
tanzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
视频和gif预览页允许通过block自定义UI
parent
7176e96a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
5 deletions
+27
-5
TZImagePickerController/TZImagePickerController/TZGifPhotoPreviewController.m
...ler/TZImagePickerController/TZGifPhotoPreviewController.m
+9
-0
TZImagePickerController/TZImagePickerController/TZImagePickerController.h
...troller/TZImagePickerController/TZImagePickerController.h
+9
-5
TZImagePickerController/TZImagePickerController/TZVideoPlayerController.m
...troller/TZImagePickerController/TZVideoPlayerController.m
+9
-0
No files found.
TZImagePickerController/TZImagePickerController/TZGifPhotoPreviewController.m
View file @
8b226a68
...
@@ -90,6 +90,10 @@
...
@@ -90,6 +90,10 @@
[
_toolBar
addSubview
:
byteLabel
];
[
_toolBar
addSubview
:
byteLabel
];
[
self
.
view
addSubview
:
_toolBar
];
[
self
.
view
addSubview
:
_toolBar
];
if
(
tzImagePickerVc
.
gifPreviewPageUIConfigBlock
)
{
tzImagePickerVc
.
gifPreviewPageUIConfigBlock
(
_toolBar
,
_doneButton
);
}
}
}
#pragma mark - Layout
#pragma mark - Layout
...
@@ -102,6 +106,11 @@
...
@@ -102,6 +106,11 @@
CGFloat
toolBarHeight
=
[
TZCommonTools
tz_isIPhoneX
]
?
44
+
(
83
-
49
)
:
44
;
CGFloat
toolBarHeight
=
[
TZCommonTools
tz_isIPhoneX
]
?
44
+
(
83
-
49
)
:
44
;
_toolBar
.
frame
=
CGRectMake
(
0
,
self
.
view
.
tz_height
-
toolBarHeight
,
self
.
view
.
tz_width
,
toolBarHeight
);
_toolBar
.
frame
=
CGRectMake
(
0
,
self
.
view
.
tz_height
-
toolBarHeight
,
self
.
view
.
tz_width
,
toolBarHeight
);
_doneButton
.
frame
=
CGRectMake
(
self
.
view
.
tz_width
-
44
-
12
,
0
,
44
,
44
);
_doneButton
.
frame
=
CGRectMake
(
self
.
view
.
tz_width
-
44
-
12
,
0
,
44
,
44
);
TZImagePickerController
*
tzImagePickerVc
=
(
TZImagePickerController
*
)
self
.
navigationController
;
if
(
tzImagePickerVc
.
gifPreviewPageDidLayoutSubviewsBlock
)
{
tzImagePickerVc
.
gifPreviewPageDidLayoutSubviewsBlock
(
_toolBar
,
_doneButton
);
}
}
}
#pragma mark - Click Event
#pragma mark - Click Event
...
...
TZImagePickerController/TZImagePickerController/TZImagePickerController.h
View file @
8b226a68
...
@@ -162,14 +162,18 @@
...
@@ -162,14 +162,18 @@
@property
(
nonatomic
,
assign
)
NSInteger
circleCropRadius
;
///< 圆形裁剪框半径大小
@property
(
nonatomic
,
assign
)
NSInteger
circleCropRadius
;
///< 圆形裁剪框半径大小
@property
(
nonatomic
,
copy
)
void
(
^
cropViewSettingBlock
)(
UIView
*
cropView
);
///< 自定义裁剪框的其他属性
@property
(
nonatomic
,
copy
)
void
(
^
cropViewSettingBlock
)(
UIView
*
cropView
);
///< 自定义裁剪框的其他属性
@property
(
nonatomic
,
copy
)
void
(
^
navLeftBarButtonSettingBlock
)(
UIButton
*
leftButton
);
///< 自定义返回按钮样式及其属性
@property
(
nonatomic
,
copy
)
void
(
^
navLeftBarButtonSettingBlock
)(
UIButton
*
leftButton
);
///< 自定义返回按钮样式及其属性
/// 【自定义照片列表页的样式】在界面初始化完成后调用,允许外界修改样式等
/// 【自定义各页面/组件的样式】在界面初始化完成后调用,允许外界修改样式等
@property
(
nonatomic
,
copy
)
void
(
^
photoPickerPageUIConfigBlock
)(
UICollectionView
*
collectionView
,
UIView
*
bottomToolBar
,
UIButton
*
previewButton
,
UIButton
*
originalPhotoButton
,
UILabel
*
originalPhotoLabel
,
UIButton
*
doneButton
,
UIImageView
*
numberImageView
,
UILabel
*
numberLabel
,
UIView
*
divideLine
);
@property
(
nonatomic
,
copy
)
void
(
^
photoPickerPageUIConfigBlock
)(
UICollectionView
*
collectionView
,
UIView
*
bottomToolBar
,
UIButton
*
previewButton
,
UIButton
*
originalPhotoButton
,
UILabel
*
originalPhotoLabel
,
UIButton
*
doneButton
,
UIImageView
*
numberImageView
,
UILabel
*
numberLabel
,
UIView
*
divideLine
);
/// 【自定义照片列表页的尺寸】在界面viewDidLayoutSubviews后调用,允许外界修改尺寸等
@property
(
nonatomic
,
copy
)
void
(
^
photoPickerPageDidLayoutSubviewsBlock
)(
UICollectionView
*
collectionView
,
UIView
*
bottomToolBar
,
UIButton
*
previewButton
,
UIButton
*
originalPhotoButton
,
UILabel
*
originalPhotoLabel
,
UIButton
*
doneButton
,
UIImageView
*
numberImageView
,
UILabel
*
numberLabel
,
UIView
*
divideLine
);
/// 【自定义照片预览页的样式】在界面初始化完成后调用,允许外界修改样式等
@property
(
nonatomic
,
copy
)
void
(
^
photoPreviewPageUIConfigBlock
)(
UICollectionView
*
collectionView
,
UIView
*
naviBar
,
UIButton
*
backButton
,
UIButton
*
selectButton
,
UILabel
*
indexLabel
,
UIView
*
toolBar
,
UIButton
*
originalPhotoButton
,
UILabel
*
originalPhotoLabel
,
UIButton
*
doneButton
,
UIImageView
*
numberImageView
,
UILabel
*
numberLabel
);
@property
(
nonatomic
,
copy
)
void
(
^
photoPreviewPageUIConfigBlock
)(
UICollectionView
*
collectionView
,
UIView
*
naviBar
,
UIButton
*
backButton
,
UIButton
*
selectButton
,
UILabel
*
indexLabel
,
UIView
*
toolBar
,
UIButton
*
originalPhotoButton
,
UILabel
*
originalPhotoLabel
,
UIButton
*
doneButton
,
UIImageView
*
numberImageView
,
UILabel
*
numberLabel
);
/// 【自定义照片预览页的尺寸】在界面viewDidLayoutSubviews后调用,允许外界修改尺寸等
@property
(
nonatomic
,
copy
)
void
(
^
videoPreviewPageUIConfigBlock
)(
UIButton
*
playButton
,
UIView
*
toolBar
,
UIButton
*
doneButton
);
@property
(
nonatomic
,
copy
)
void
(
^
gifPreviewPageUIConfigBlock
)(
UIView
*
toolBar
,
UIButton
*
doneButton
);
/// 【自定义各页面/组件的frame】在界面viewDidLayoutSubviews后调用,允许外界修改尺寸等
@property
(
nonatomic
,
copy
)
void
(
^
photoPickerPageDidLayoutSubviewsBlock
)(
UICollectionView
*
collectionView
,
UIView
*
bottomToolBar
,
UIButton
*
previewButton
,
UIButton
*
originalPhotoButton
,
UILabel
*
originalPhotoLabel
,
UIButton
*
doneButton
,
UIImageView
*
numberImageView
,
UILabel
*
numberLabel
,
UIView
*
divideLine
);
@property
(
nonatomic
,
copy
)
void
(
^
photoPreviewPageDidLayoutSubviewsBlock
)(
UICollectionView
*
collectionView
,
UIView
*
naviBar
,
UIButton
*
backButton
,
UIButton
*
selectButton
,
UILabel
*
indexLabel
,
UIView
*
toolBar
,
UIButton
*
originalPhotoButton
,
UILabel
*
originalPhotoLabel
,
UIButton
*
doneButton
,
UIImageView
*
numberImageView
,
UILabel
*
numberLabel
);
@property
(
nonatomic
,
copy
)
void
(
^
photoPreviewPageDidLayoutSubviewsBlock
)(
UICollectionView
*
collectionView
,
UIView
*
naviBar
,
UIButton
*
backButton
,
UIButton
*
selectButton
,
UILabel
*
indexLabel
,
UIView
*
toolBar
,
UIButton
*
originalPhotoButton
,
UILabel
*
originalPhotoLabel
,
UIButton
*
doneButton
,
UIImageView
*
numberImageView
,
UILabel
*
numberLabel
);
@property
(
nonatomic
,
copy
)
void
(
^
videoPreviewPageDidLayoutSubviewsBlock
)(
UIButton
*
playButton
,
UIView
*
toolBar
,
UIButton
*
doneButton
);
@property
(
nonatomic
,
copy
)
void
(
^
gifPreviewPageDidLayoutSubviewsBlock
)(
UIView
*
toolBar
,
UIButton
*
doneButton
);
#pragma mark -
#pragma mark -
-
(
id
)
showAlertWithTitle
:(
NSString
*
)
title
;
-
(
id
)
showAlertWithTitle
:(
NSString
*
)
title
;
...
...
TZImagePickerController/TZImagePickerController/TZVideoPlayerController.m
View file @
8b226a68
...
@@ -121,6 +121,10 @@
...
@@ -121,6 +121,10 @@
[
_doneButton
setTitleColor
:
tzImagePickerVc
.
oKButtonTitleColorDisabled
forState
:
UIControlStateDisabled
];
[
_doneButton
setTitleColor
:
tzImagePickerVc
.
oKButtonTitleColorDisabled
forState
:
UIControlStateDisabled
];
[
_toolBar
addSubview
:
_doneButton
];
[
_toolBar
addSubview
:
_doneButton
];
[
self
.
view
addSubview
:
_toolBar
];
[
self
.
view
addSubview
:
_toolBar
];
if
(
tzImagePickerVc
.
videoPreviewPageUIConfigBlock
)
{
tzImagePickerVc
.
videoPreviewPageUIConfigBlock
(
_playButton
,
_toolBar
,
_doneButton
);
}
}
}
#pragma mark - Layout
#pragma mark - Layout
...
@@ -135,6 +139,11 @@
...
@@ -135,6 +139,11 @@
_toolBar
.
frame
=
CGRectMake
(
0
,
self
.
view
.
tz_height
-
toolBarHeight
,
self
.
view
.
tz_width
,
toolBarHeight
);
_toolBar
.
frame
=
CGRectMake
(
0
,
self
.
view
.
tz_height
-
toolBarHeight
,
self
.
view
.
tz_width
,
toolBarHeight
);
_doneButton
.
frame
=
CGRectMake
(
self
.
view
.
tz_width
-
44
-
12
,
0
,
44
,
44
);
_doneButton
.
frame
=
CGRectMake
(
self
.
view
.
tz_width
-
44
-
12
,
0
,
44
,
44
);
_playButton
.
frame
=
CGRectMake
(
0
,
statusBarAndNaviBarHeight
,
self
.
view
.
tz_width
,
self
.
view
.
tz_height
-
statusBarAndNaviBarHeight
-
toolBarHeight
);
_playButton
.
frame
=
CGRectMake
(
0
,
statusBarAndNaviBarHeight
,
self
.
view
.
tz_width
,
self
.
view
.
tz_height
-
statusBarAndNaviBarHeight
-
toolBarHeight
);
TZImagePickerController
*
tzImagePickerVc
=
(
TZImagePickerController
*
)
self
.
navigationController
;
if
(
tzImagePickerVc
.
videoPreviewPageDidLayoutSubviewsBlock
)
{
tzImagePickerVc
.
videoPreviewPageDidLayoutSubviewsBlock
(
_playButton
,
_toolBar
,
_doneButton
);
}
}
}
#pragma mark - Click Event
#pragma mark - Click Event
...
...
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