Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
react-native-picker
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ym
react-native-picker
Commits
bc4c976f
Commit
bc4c976f
authored
Nov 04, 2016
by
xwenliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #85: iOS<9.0 cant set height of picker view
parent
d199b354
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
ios/RCTBEEPickerManager/RCTBEEPickerManager.m
ios/RCTBEEPickerManager/RCTBEEPickerManager.m
+11
-4
package.json
package.json
+1
-1
No files found.
ios/RCTBEEPickerManager/RCTBEEPickerManager.m
View file @
bc4c976f
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
@interface
RCTBEEPickerManager
()
@interface
RCTBEEPickerManager
()
@property
(
nonatomic
,
strong
)
BzwPicker
*
pick
;
@property
(
nonatomic
,
strong
)
BzwPicker
*
pick
;
@property
(
nonatomic
,
assign
)
float
height
;
@end
@end
...
@@ -79,7 +80,13 @@ RCT_EXPORT_METHOD(_init:(NSDictionary *)indic){
...
@@ -79,7 +80,13 @@ RCT_EXPORT_METHOD(_init:(NSDictionary *)indic){
}];
}];
self
.
pick
=
[[
BzwPicker
alloc
]
initWithFrame
:
CGRectMake
(
0
,
SCREEN_HEIGHT
,
SCREEN_WIDTH
,
250
)
dic
:
dataDic
leftStr
:
pickerCancelBtnText
centerStr
:
pickerTitleText
rightStr
:
pickerConfirmBtnText
topbgColor
:
pickerToolBarBg
bottombgColor
:
pickerBg
leftbtnbgColor
:
pickerCancelBtnColor
rightbtnbgColor
:
pickerConfirmBtnColor
centerbtnColor
:
pickerTitleColor
selectValueArry
:
selectArry
weightArry
:
weightArry
];
if
([[
UIDevice
currentDevice
].
systemVersion
doubleValue
]
>=
9
.
0
){
self
.
height
=
250
;
}
else
{
self
.
height
=
220
;
}
self
.
pick
=
[[
BzwPicker
alloc
]
initWithFrame
:
CGRectMake
(
0
,
SCREEN_HEIGHT
,
SCREEN_WIDTH
,
self
.
height
)
dic
:
dataDic
leftStr
:
pickerCancelBtnText
centerStr
:
pickerTitleText
rightStr
:
pickerConfirmBtnText
topbgColor
:
pickerToolBarBg
bottombgColor
:
pickerBg
leftbtnbgColor
:
pickerCancelBtnColor
rightbtnbgColor
:
pickerConfirmBtnColor
centerbtnColor
:
pickerTitleColor
selectValueArry
:
selectArry
weightArry
:
weightArry
];
_pick
.
bolock
=^
(
NSDictionary
*
backinfoArry
){
_pick
.
bolock
=^
(
NSDictionary
*
backinfoArry
){
...
@@ -95,7 +102,7 @@ RCT_EXPORT_METHOD(_init:(NSDictionary *)indic){
...
@@ -95,7 +102,7 @@ RCT_EXPORT_METHOD(_init:(NSDictionary *)indic){
[
UIView
animateWithDuration
:.
3
animations
:
^
{
[
UIView
animateWithDuration
:.
3
animations
:
^
{
[
_pick
setFrame
:
CGRectMake
(
0
,
SCREEN_HEIGHT
-
250
,
SCREEN_WIDTH
,
250
)];
[
_pick
setFrame
:
CGRectMake
(
0
,
SCREEN_HEIGHT
-
self
.
height
,
SCREEN_WIDTH
,
self
.
height
)];
}];
}];
...
@@ -109,7 +116,7 @@ RCT_EXPORT_METHOD(show){
...
@@ -109,7 +116,7 @@ RCT_EXPORT_METHOD(show){
dispatch_async
(
dispatch_get_main_queue
(),
^
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
UIView
animateWithDuration
:.
3
animations
:
^
{
[
UIView
animateWithDuration
:.
3
animations
:
^
{
[
_pick
setFrame
:
CGRectMake
(
0
,
SCREEN_HEIGHT
-
250
,
SCREEN_WIDTH
,
250
)];
[
_pick
setFrame
:
CGRectMake
(
0
,
SCREEN_HEIGHT
-
self
.
height
,
SCREEN_WIDTH
,
self
.
height
)];
}];
}];
});
});
...
@@ -121,7 +128,7 @@ RCT_EXPORT_METHOD(hide){
...
@@ -121,7 +128,7 @@ RCT_EXPORT_METHOD(hide){
if
(
self
.
pick
)
{
if
(
self
.
pick
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
UIView
animateWithDuration
:.
3
animations
:
^
{
[
UIView
animateWithDuration
:.
3
animations
:
^
{
[
_pick
setFrame
:
CGRectMake
(
0
,
SCREEN_HEIGHT
,
SCREEN_WIDTH
,
250
)];
[
_pick
setFrame
:
CGRectMake
(
0
,
SCREEN_HEIGHT
,
SCREEN_WIDTH
,
self
.
height
)];
}];
}];
});
});
}
return
;
}
return
;
...
...
package.json
View file @
bc4c976f
{
{
"name"
:
"react-native-picker"
,
"name"
:
"react-native-picker"
,
"version"
:
"4.0.
8
"
,
"version"
:
"4.0.
9
"
,
"description"
:
""
,
"description"
:
""
,
"main"
:
"index.js"
,
"main"
:
"index.js"
,
"scripts"
:
{
"scripts"
:
{
...
...
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