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
b788a593
Commit
b788a593
authored
Dec 07, 2016
by
banchichen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
可以设置不进入预览页面
parent
90a5682e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
5 deletions
+22
-5
TZImagePickerController/Base.lproj/Main.storyboard
TZImagePickerController/Base.lproj/Main.storyboard
+2
-2
TZImagePickerController/TZImagePickerController/TZImagePickerController.h
...troller/TZImagePickerController/TZImagePickerController.h
+4
-0
TZImagePickerController/TZImagePickerController/TZImagePickerController.m
...troller/TZImagePickerController/TZImagePickerController.m
+1
-0
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m
...troller/TZImagePickerController/TZPhotoPickerController.m
+9
-3
TZImagePickerController/ViewController.m
TZImagePickerController/ViewController.m
+6
-0
No files found.
TZImagePickerController/Base.lproj/Main.storyboard
View file @
b788a593
...
...
@@ -192,7 +192,7 @@
<rect
key=
"frame"
x=
"0.0"
y=
"300"
width=
"320"
height=
"35"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<subviews>
<switch
opaque=
"NO"
contentMode=
"scaleToFill"
horizontalHuggingPriority=
"750"
verticalHuggingPriority=
"750"
fixedFrame=
"YES"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
on=
"YES"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"0ju-HJ-A06"
>
<switch
opaque=
"NO"
contentMode=
"scaleToFill"
horizontalHuggingPriority=
"750"
verticalHuggingPriority=
"750"
fixedFrame=
"YES"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"0ju-HJ-A06"
>
<rect
key=
"frame"
x=
"225"
y=
"2"
width=
"51"
height=
"31"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<connections>
...
...
@@ -213,7 +213,7 @@
<rect
key=
"frame"
x=
"0.0"
y=
"335"
width=
"320"
height=
"35"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<subviews>
<switch
opaque=
"NO"
contentMode=
"scaleToFill"
horizontalHuggingPriority=
"750"
verticalHuggingPriority=
"750"
fixedFrame=
"YES"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
on=
"YES"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"hsH-wt-l1R"
>
<switch
opaque=
"NO"
contentMode=
"scaleToFill"
horizontalHuggingPriority=
"750"
verticalHuggingPriority=
"750"
fixedFrame=
"YES"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"hsH-wt-l1R"
>
<rect
key=
"frame"
x=
"225"
y=
"2"
width=
"51"
height=
"31"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<connections>
...
...
TZImagePickerController/TZImagePickerController/TZImagePickerController.h
View file @
b788a593
...
...
@@ -77,6 +77,10 @@
/// 默认为YES,如果设置为NO,拍照按钮将隐藏,用户将不能在选择器中拍照
@property
(
nonatomic
,
assign
)
BOOL
allowTakePicture
;
/// Default is YES.if set NO, user can't preview photo.
/// 默认为YES,如果设置为NO,预览按钮将隐藏,用户将不能去预览照片
@property
(
nonatomic
,
assign
)
BOOL
allowPreview
;
/// Default is YES.if set NO, the picker don't dismiss itself.
/// 默认为YES,如果设置为NO, 选择器将不会自己dismiss
@property
(
nonatomic
,
assign
)
BOOL
autoDismiss
;
...
...
TZImagePickerController/TZImagePickerController/TZImagePickerController.m
View file @
b788a593
...
...
@@ -202,6 +202,7 @@
self
.
photoPreviewMaxWidth
=
600
;
self
.
barItemTextFont
=
[
UIFont
systemFontOfSize
:
15
];
self
.
barItemTextColor
=
[
UIColor
whiteColor
];
self
.
allowPreview
=
YES
;
[
self
configDefaultImageName
];
[
self
configDefaultBtnTitle
];
...
...
TZImagePickerController/TZImagePickerController/TZPhotoPickerController.m
View file @
b788a593
...
...
@@ -165,10 +165,13 @@ static CGSize AssetGridThumbnailSize;
CGFloat
rgb
=
253
/
255
.
0
;
bottomToolBar
.
backgroundColor
=
[
UIColor
colorWithRed
:
rgb
green
:
rgb
blue
:
rgb
alpha
:
1
.
0
];
CGFloat
previewWidth
=
[
tzImagePickerVc
.
previewBtnTitleStr
boundingRectWithSize
:
CGSizeMake
(
CGFLOAT_MAX
,
CGFLOAT_MAX
)
options
:
NSStringDrawingUsesFontLeading
attributes
:
@{
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
16
]}
context
:
nil
].
size
.
width
;
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
;
}
_previewButton
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
_previewButton
.
frame
=
CGRectMake
(
10
,
3
,
previewWidth
+
2
,
44
);
_previewButton
.
tz_width
=
!
tzImagePickerVc
.
showSelectBtn
?
0
:
previewWidth
+
2
;
_previewButton
.
frame
=
CGRectMake
(
10
,
3
,
previewWidth
,
44
);
_previewButton
.
tz_width
=
!
tzImagePickerVc
.
showSelectBtn
?
0
:
previewWidth
;
[
_previewButton
addTarget
:
self
action
:
@selector
(
previewButtonClick
)
forControlEvents
:
UIControlEventTouchUpInside
];
_previewButton
.
titleLabel
.
font
=
[
UIFont
systemFontOfSize
:
16
];
[
_previewButton
setTitle
:
tzImagePickerVc
.
previewBtnTitleStr
forState
:
UIControlStateNormal
];
...
...
@@ -363,6 +366,9 @@ static CGSize AssetGridThumbnailSize;
}
cell
.
model
=
model
;
cell
.
showSelectBtn
=
tzImagePickerVc
.
showSelectBtn
;
if
(
!
tzImagePickerVc
.
allowPreview
)
{
cell
.
selectPhotoButton
.
frame
=
cell
.
bounds
;
}
__weak
typeof
(
cell
)
weakCell
=
cell
;
__weak
typeof
(
self
)
weakSelf
=
self
;
...
...
TZImagePickerController/ViewController.m
View file @
b788a593
...
...
@@ -233,6 +233,8 @@
cropView.layer.borderColor = [UIColor redColor].CGColor;
cropView.layer.borderWidth = 2.0;
}];*/
//imagePickerVc.allowPreview = NO;
#pragma mark - 到这里为止
// You can get the photos by block, the same as by delegate.
...
...
@@ -434,6 +436,8 @@
-
(
IBAction
)
allowPickingOriginPhotoSwitchClick
:(
UISwitch
*
)
sender
{
if
(
sender
.
isOn
)
{
[
_allowPickingImageSwitch
setOn
:
YES
animated
:
YES
];
[
self
.
needCircleCropSwitch
setOn
:
NO
animated
:
YES
];
[
self
.
allowCropSwitch
setOn
:
NO
animated
:
YES
];
}
}
...
...
@@ -454,6 +458,7 @@
-
(
IBAction
)
allowCropSwitchClick
:(
UISwitch
*
)
sender
{
if
(
sender
.
isOn
)
{
self
.
maxCountTF
.
text
=
@"1"
;
[
self
.
allowPickingOriginalPhotoSwitch
setOn
:
NO
animated
:
YES
];
}
else
{
[
self
.
needCircleCropSwitch
setOn
:
NO
animated
:
YES
];
}
...
...
@@ -463,6 +468,7 @@
if
(
sender
.
isOn
)
{
[
self
.
allowCropSwitch
setOn
:
YES
animated
:
YES
];
self
.
maxCountTF
.
text
=
@"1"
;
[
self
.
allowPickingOriginalPhotoSwitch
setOn
:
NO
animated
:
YES
];
}
}
...
...
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