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
8d95717d
Commit
8d95717d
authored
Oct 09, 2016
by
tanzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自定义TZCollectionView,优化照片列表页的滑动
parent
e993595c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
7 deletions
+35
-7
TZImagePickerController/Assets.xcassets/AppIcon.appiconset/Contents.json
...ntroller/Assets.xcassets/AppIcon.appiconset/Contents.json
+10
-0
TZImagePickerController/TZImagePickerController/TZAssetCell.m
...agePickerController/TZImagePickerController/TZAssetCell.m
+5
-5
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.h
...troller/TZImagePickerController/TZPhotoPickerController.h
+5
-0
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m
...troller/TZImagePickerController/TZPhotoPickerController.m
+15
-2
No files found.
TZImagePickerController/Assets.xcassets/AppIcon.appiconset/Contents.json
View file @
8d95717d
{
{
"images"
:
[
"images"
:
[
{
"idiom"
:
"iphone"
,
"size"
:
"20x20"
,
"scale"
:
"2x"
},
{
"idiom"
:
"iphone"
,
"size"
:
"20x20"
,
"scale"
:
"3x"
},
{
{
"idiom"
:
"iphone"
,
"idiom"
:
"iphone"
,
"size"
:
"29x29"
,
"size"
:
"29x29"
,
...
...
TZImagePickerController/TZImagePickerController/TZAssetCell.m
View file @
8d95717d
...
@@ -106,11 +106,11 @@
...
@@ -106,11 +106,11 @@
-
(
UIButton
*
)
selectPhotoButton
{
-
(
UIButton
*
)
selectPhotoButton
{
if
(
_selectImageView
==
nil
)
{
if
(
_selectImageView
==
nil
)
{
UIButton
*
select
ImageView
=
[[
UIButton
alloc
]
init
];
UIButton
*
select
PhotoButton
=
[[
UIButton
alloc
]
init
];
select
ImageView
.
frame
=
CGRectMake
(
self
.
tz_width
-
44
,
0
,
44
,
44
);
select
PhotoButton
.
frame
=
CGRectMake
(
self
.
tz_width
-
44
,
0
,
44
,
44
);
[
select
ImageView
addTarget
:
self
action
:
@selector
(
selectPhotoButtonClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
select
PhotoButton
addTarget
:
self
action
:
@selector
(
selectPhotoButtonClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
contentView
addSubview
:
select
ImageView
];
[
self
.
contentView
addSubview
:
select
PhotoButton
];
_selectPhotoButton
=
select
ImageView
;
_selectPhotoButton
=
select
PhotoButton
;
}
}
return
_selectPhotoButton
;
return
_selectPhotoButton
;
}
}
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.h
View file @
8d95717d
...
@@ -18,3 +18,8 @@
...
@@ -18,3 +18,8 @@
@property
(
nonatomic
,
copy
)
void
(
^
backButtonClickHandle
)(
TZAlbumModel
*
model
);
@property
(
nonatomic
,
copy
)
void
(
^
backButtonClickHandle
)(
TZAlbumModel
*
model
);
@end
@end
@interface
TZCollectionView
:
UICollectionView
@end
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m
View file @
8d95717d
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
}
}
@property
CGRect
previousPreheatRect
;
@property
CGRect
previousPreheatRect
;
@property
(
nonatomic
,
assign
)
BOOL
isSelectOriginalPhoto
;
@property
(
nonatomic
,
assign
)
BOOL
isSelectOriginalPhoto
;
@property
(
nonatomic
,
strong
)
UI
CollectionView
*
collectionView
;
@property
(
nonatomic
,
strong
)
TZ
CollectionView
*
collectionView
;
@property
(
nonatomic
,
strong
)
UIImagePickerController
*
imagePickerVc
;
@property
(
nonatomic
,
strong
)
UIImagePickerController
*
imagePickerVc
;
@end
@end
...
@@ -122,7 +122,7 @@ static CGSize AssetGridThumbnailSize;
...
@@ -122,7 +122,7 @@ static CGSize AssetGridThumbnailSize;
CGFloat
top
=
44
;
CGFloat
top
=
44
;
if
(
iOS7Later
)
top
+=
20
;
if
(
iOS7Later
)
top
+=
20
;
CGFloat
collectionViewHeight
=
tzImagePickerVc
.
maxImagesCount
>
1
?
self
.
view
.
tz_height
-
50
-
top
:
self
.
view
.
tz_height
-
top
;
CGFloat
collectionViewHeight
=
tzImagePickerVc
.
maxImagesCount
>
1
?
self
.
view
.
tz_height
-
50
-
top
:
self
.
view
.
tz_height
-
top
;
_collectionView
=
[[
UI
CollectionView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
top
,
self
.
view
.
tz_width
,
collectionViewHeight
)
collectionViewLayout
:
layout
];
_collectionView
=
[[
TZ
CollectionView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
top
,
self
.
view
.
tz_width
,
collectionViewHeight
)
collectionViewLayout
:
layout
];
_collectionView
.
backgroundColor
=
[
UIColor
whiteColor
];
_collectionView
.
backgroundColor
=
[
UIColor
whiteColor
];
_collectionView
.
dataSource
=
self
;
_collectionView
.
dataSource
=
self
;
_collectionView
.
delegate
=
self
;
_collectionView
.
delegate
=
self
;
...
@@ -719,3 +719,16 @@ static CGSize AssetGridThumbnailSize;
...
@@ -719,3 +719,16 @@ static CGSize AssetGridThumbnailSize;
}
}
@end
@end
@implementation
TZCollectionView
-
(
BOOL
)
touchesShouldCancelInContentView
:(
UIView
*
)
view
{
if
(
[
view
isKindOfClass
:[
UIControl
class
]])
{
return
YES
;
}
return
[
super
touchesShouldCancelInContentView
:
view
];
}
@end
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