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
5270cd03
Commit
5270cd03
authored
7 years ago
by
Matt Kane
Committed by
zooble
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow user to specify picker row height on iOS (#204)
Allow user to specify row height for iOS
parent
e8ff6cc7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
10 deletions
+28
-10
README.md
README.md
+1
-0
index.d.ts
index.d.ts
+10
-0
index.js
index.js
+1
-1
ios/RCTBEEPickerManager/BzwPicker.h
ios/RCTBEEPickerManager/BzwPicker.h
+3
-2
ios/RCTBEEPickerManager/BzwPicker.m
ios/RCTBEEPickerManager/BzwPicker.m
+8
-1
ios/RCTBEEPickerManager/RCTBEEPickerManager.m
ios/RCTBEEPickerManager/RCTBEEPickerManager.m
+5
-6
No files found.
README.md
View file @
5270cd03
...
...
@@ -22,6 +22,7 @@
|pickerToolBarFontSize | |number |16 |
|wheelFlex | |array |[1, 1, 1] |
|pickerFontSize | |number |16 |
|pickerRowHeight | |number |24 |
|pickerFontColor | |array |[31, 31, 31, 1] |
|pickerData | |array | |
|selectedValue | |array | |
...
...
This diff is collapsed.
Click to expand it.
index.d.ts
View file @
5270cd03
...
...
@@ -148,6 +148,16 @@ interface PickerOptions {
*/
pickerFontSize
?:
number
/**
* Row height of the items in the picker
*
* Default is 24
*
* @type {number}
* @memberof PickerOptions
*/
pickerRowHeight
?:
number
/**
* Color of the text for the items in the picker
*
...
...
This diff is collapsed.
Click to expand it.
index.js
View file @
5270cd03
...
...
@@ -17,6 +17,7 @@ const options = {
pickerTitleColor
:
[
20
,
20
,
20
,
1
],
pickerToolBarBg
:
[
232
,
232
,
232
,
1
],
pickerBg
:
[
196
,
199
,
206
,
1
],
pickerRowHeight
:
24
,
wheelFlex
:
[
1
,
1
,
1
],
pickerData
:
[],
selectedValue
:
[],
...
...
@@ -29,7 +30,6 @@ const options = {
};
export
default
{
init
(
params
){
const
opt
=
{
...
options
,
...
...
This diff is collapsed.
Click to expand it.
ios/RCTBEEPickerManager/BzwPicker.h
View file @
5270cd03
...
...
@@ -41,7 +41,8 @@ typedef void(^backBolock)(NSDictionary * );
@property
(
strong
,
nonatomic
)
NSString
*
rightStr
;
@property
(
strong
,
nonatomic
)
NSString
*
pickerToolBarFontSize
;
@property
(
strong
,
nonatomic
)
NSString
*
pickerFontSize
;
@property
(
strong
,
nonatomic
)
NSArray
*
pickerFontColor
;
@property
(
strong
,
nonatomic
)
NSArray
*
pickerFontColor
;
@property
(
strong
,
nonatomic
)
NSString
*
pickerRowHeight
;
...
...
@@ -78,7 +79,7 @@ typedef void(^backBolock)(NSDictionary * );
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
dic
:(
NSDictionary
*
)
dic
leftStr
:(
NSString
*
)
leftStr
centerStr
:(
NSString
*
)
centerStr
rightStr
:(
NSString
*
)
rightStr
topbgColor
:(
NSArray
*
)
topbgColor
bottombgColor
:(
NSArray
*
)
bottombgColor
leftbtnbgColor
:(
NSArray
*
)
leftbtnbgColor
rightbtnbgColor
:(
NSArray
*
)
rightbtnbgColor
centerbtnColor
:(
NSArray
*
)
centerbtnColor
selectValueArry
:(
NSArray
*
)
selectValueArry
weightArry
:(
NSArray
*
)
weightArry
pickerToolBarFontSize
:(
NSString
*
)
pickerToolBarFontSize
pickerFontSize
:(
NSString
*
)
pickerFontSize
pickerFontColor
:(
NSArray
*
)
pickerFontColor
;
pickerToolBarFontSize
:(
NSString
*
)
pickerToolBarFontSize
pickerFontSize
:(
NSString
*
)
pickerFontSize
pickerFontColor
:(
NSArray
*
)
pickerFontColor
pickerRowHeight
:(
NSString
*
)
pickerRowHeight
;
-
(
void
)
selectRow
;
@end
This diff is collapsed.
Click to expand it.
ios/RCTBEEPickerManager/BzwPicker.m
View file @
5270cd03
...
...
@@ -12,7 +12,7 @@
@implementation
BzwPicker
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
dic
:(
NSDictionary
*
)
dic
leftStr
:(
NSString
*
)
leftStr
centerStr
:(
NSString
*
)
centerStr
rightStr
:(
NSString
*
)
rightStr
topbgColor
:(
NSArray
*
)
topbgColor
bottombgColor
:(
NSArray
*
)
bottombgColor
leftbtnbgColor
:(
NSArray
*
)
leftbtnbgColor
rightbtnbgColor
:(
NSArray
*
)
rightbtnbgColor
centerbtnColor
:(
NSArray
*
)
centerbtnColor
selectValueArry
:(
NSArray
*
)
selectValueArry
weightArry
:(
NSArray
*
)
weightArry
pickerToolBarFontSize
:(
NSString
*
)
pickerToolBarFontSize
pickerFontSize
:(
NSString
*
)
pickerFontSize
pickerFontColor
:(
NSArray
*
)
pickerFontColor
pickerToolBarFontSize
:(
NSString
*
)
pickerToolBarFontSize
pickerFontSize
:(
NSString
*
)
pickerFontSize
pickerFontColor
:(
NSArray
*
)
pickerFontColor
pickerRowHeight
:(
NSString
*
)
pickerRowHeight
{
self
=
[
super
initWithFrame
:
frame
];
...
...
@@ -30,6 +30,7 @@
self
.
pickerToolBarFontSize
=
pickerToolBarFontSize
;
self
.
pickerFontSize
=
pickerFontSize
;
self
.
pickerFontColor
=
pickerFontColor
;
self
.
pickerRowHeight
=
pickerRowHeight
;
[
self
getStyle
];
[
self
getnumStyle
];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
...
...
@@ -469,6 +470,12 @@
self
.
bolock
(
dic
);
}
}
-
(
CGFloat
)
pickerView
:(
UIPickerView
*
)
pickerView
rowHeightForComponent
:(
NSInteger
)
component
{
return
self
.
pickerRowHeight
.
integerValue
;
}
//判断进来的类型是那种
-
(
void
)
getStyle
{
...
...
This diff is collapsed.
Click to expand it.
ios/RCTBEEPickerManager/RCTBEEPickerManager.m
View file @
5270cd03
...
...
@@ -8,7 +8,7 @@
#import "RCTBEEPickerManager.h"
#import "BzwPicker.h"
#import
"RCTEventDispatcher.h"
#import
<React/RCTEventDispatcher.h>
@interface
RCTBEEPickerManager
()
...
...
@@ -55,7 +55,7 @@ RCT_EXPORT_METHOD(_init:(NSDictionary *)indic){
NSString
*
pickerToolBarFontSize
=
[
NSString
stringWithFormat
:
@"%@"
,
indic
[
@"pickerToolBarFontSize"
]];
NSString
*
pickerFontSize
=
[
NSString
stringWithFormat
:
@"%@"
,
indic
[
@"pickerFontSize"
]];
NSArray
*
pickerFontColor
=
indic
[
@"pickerFontColor"
];
NSString
*
pickerRowHeight
=
indic
[
@"pickerRowHeight"
];
id
pickerData
=
indic
[
@"pickerData"
];
NSMutableDictionary
*
dataDic
=
[[
NSMutableDictionary
alloc
]
init
];
...
...
@@ -78,10 +78,9 @@ RCT_EXPORT_METHOD(_init:(NSDictionary *)indic){
}
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
pickerToolBarFontSize
:
pickerToolBarFontSize
pickerFontSize
:
pickerFontSize
pickerFontColor
:
pickerFontColor
];
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
pickerToolBarFontSize
:
pickerToolBarFontSize
pickerFontSize
:
pickerFontSize
pickerFontColor
:
pickerFontColor
pickerRowHeight
:
pickerRowHeight
];
_pick
.
bolock
=^
(
NSDictionary
*
backinfoArry
){
dispatch_async
(
dispatch_get_main_queue
(),
^
{
...
...
This diff is collapsed.
Click to expand it.
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