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
d6ad6759
Commit
d6ad6759
authored
Dec 26, 2016
by
xwenliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New features for #102 #90 #29
parent
cf30fbc6
Changes
15
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
553 additions
and
266 deletions
+553
-266
README.md
README.md
+19
-17
android/src/main/AndroidManifest.xml
android/src/main/AndroidManifest.xml
+1
-1
android/src/main/java/com/beefe/picker/PickerViewModule.java
android/src/main/java/com/beefe/picker/PickerViewModule.java
+98
-65
android/src/main/java/com/beefe/picker/view/LoopView.java
android/src/main/java/com/beefe/picker/view/LoopView.java
+19
-18
android/src/main/java/com/beefe/picker/view/OnSelectedListener.java
...c/main/java/com/beefe/picker/view/OnSelectedListener.java
+1
-1
android/src/main/java/com/beefe/picker/view/PickerViewAlone.java
.../src/main/java/com/beefe/picker/view/PickerViewAlone.java
+61
-17
android/src/main/java/com/beefe/picker/view/PickerViewLinkage.java
...rc/main/java/com/beefe/picker/view/PickerViewLinkage.java
+156
-48
android/src/main/java/com/beefe/picker/view/ReturnData.java
android/src/main/java/com/beefe/picker/view/ReturnData.java
+27
-0
android/src/main/res/values/styles.xml
android/src/main/res/values/styles.xml
+1
-1
example/PickerTest/index.js
example/PickerTest/index.js
+10
-7
index.js
index.js
+15
-15
ios/RCTBEEPickerManager/BzwPicker.h
ios/RCTBEEPickerManager/BzwPicker.h
+8
-1
ios/RCTBEEPickerManager/BzwPicker.m
ios/RCTBEEPickerManager/BzwPicker.m
+125
-71
ios/RCTBEEPickerManager/RCTBEEPickerManager.m
ios/RCTBEEPickerManager/RCTBEEPickerManager.m
+11
-3
package.json
package.json
+1
-1
No files found.
README.md
View file @
d6ad6759
...
...
@@ -10,22 +10,24 @@
####Params
|Key | Type | Default| Description |
| --- | ---- | ------ | ----------- |
|pickerConfirmBtnText |string |确认 | |
|pickerCancelBtnText |string |取消 | |
|pickerTitleText |string |请选择 | |
|pickerConfirmBtnColor |array |[1, 186, 245, 1] | |
|pickerCancelBtnColor |array |[1, 186, 245, 1] | |
|pickerTitleColor |array |[20, 20, 20, 1]) | |
|pickerToolBarBg |array |[232, 232, 232, 1] | |
|pickerBg |array |[196, 199, 206, 1] | |
|wheelFlex |array |[2, 1, 1] |set width of the three wheels to 2:1:1 |
|pickerData |array | | |
|selectedValue |array | | |
|onPickerConfirm |function| | |
|onPickerCancel |function| | |
|onPickerSelect |function| | |
|Key | Description | Type | Default|
| --- | ----------- | ---- | ------ |
|pickerConfirmBtnText | |string |confirm |
|pickerCancelBtnText | |string |cancel |
|pickerTitleText | |string |pls select |
|pickerConfirmBtnColor | |array |[1, 186, 245, 1] |
|pickerCancelBtnColor | |array |[1, 186, 245, 1] |
|pickerTitleColor | |array |[20, 20, 20, 1]) |
|pickerToolBarBg | |array |[232, 232, 232, 1] |
|pickerBg | |array |[196, 199, 206, 1] |
|pickerToolBarFontSize | |number |16 |
|pickerFontSize | |number |16 |
|pickerFontColor | |array |[31, 31, 31, 1] |
|pickerData | |array | |
|selectedValue | |string | |
|onPickerConfirm | |function| |
|onPickerCancel | |function| |
|onPickerSelect | |function| |
####Methods
...
...
@@ -93,7 +95,7 @@
```
javascript
pickerData
=
[
1
,
2
,
3
,
4
];
selectedValue
=
[
3
]
;
selectedValue
=
3
;
```
-
two or more wheel:
...
...
android/src/main/AndroidManifest.xml
View file @
d6ad6759
android/src/main/java/com/beefe/picker/PickerViewModule.java
View file @
d6ad6759
This diff is collapsed.
Click to expand it.
android/src/main/java/com/beefe/picker/view/LoopView.java
View file @
d6ad6759
...
...
@@ -19,9 +19,13 @@ import java.util.concurrent.ScheduledFuture;
import
java.util.concurrent.TimeUnit
;
/**
* Edited by
shexiaoheng
on 2016/10/20
* Edited by
<a href="https://github.com/shexiaoheng">heng</a>
on 2016/10/20
* 1. Added method getY
* 2. Changed line color 0xffc5c5c5 -> 0xffb8bbc2
*
* Edited by heng on 2016/12/26
* 1. Added setTextColor
* 2. Added setTextSize
*/
public
class
LoopView
extends
View
{
...
...
@@ -50,10 +54,6 @@ public class LoopView extends View {
private
int
textSize
;
int
maxTextHeight
;
private
int
colorGray
;
private
int
colorBlack
;
private
int
colorLightGray
;
// 条目间距倍数
float
lineSpacingMultiplier
;
boolean
isLoop
;
...
...
@@ -109,37 +109,30 @@ public class LoopView extends View {
lineSpacingMultiplier
=
2.0
F
;
isLoop
=
true
;
itemsVisible
=
9
;
textSize
=
0
;
colorGray
=
0xffafafaf
;
colorBlack
=
0xff313131
;
colorLightGray
=
0xffb8bbc2
;
// colorLightGray = 0xffc5c5c5;
textSize
=
(
int
)
(
context
.
getResources
().
getDisplayMetrics
().
density
*
16
);
totalScrollY
=
0
;
initPosition
=
-
1
;
initPaints
();
setTextSize
(
20
F
);
}
private
void
initPaints
()
{
paintOuterText
=
new
Paint
();
paintOuterText
.
setColor
(
colorGray
);
paintOuterText
.
setColor
(
0xffafafaf
);
paintOuterText
.
setAntiAlias
(
true
);
paintOuterText
.
setTypeface
(
Typeface
.
MONOSPACE
);
paintOuterText
.
setTextSize
(
textSize
);
paintCenterText
=
new
Paint
();
paintCenterText
.
setColor
(
colorBlack
);
paintCenterText
.
setColor
(
0xff000000
);
paintCenterText
.
setAntiAlias
(
true
);
paintCenterText
.
setTextScaleX
(
scaleX
);
paintCenterText
.
setTypeface
(
Typeface
.
MONOSPACE
);
paintCenterText
.
setTextSize
(
textSize
);
paintIndicator
=
new
Paint
();
paintIndicator
.
setColor
(
colorLightGray
);
paintIndicator
.
setColor
(
0xffb8bbc2
);
paintIndicator
.
setAntiAlias
(
true
);
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
11
)
{
...
...
@@ -204,15 +197,22 @@ public class LoopView extends View {
}
}
public
void
setTextColor
(
int
color
){
paintCenterText
.
setColor
(
color
);
invalidate
();
}
public
final
void
setNotLoop
()
{
isLoop
=
false
;
}
public
final
void
setTextSize
(
float
size
)
{
if
(
size
>
0.0
F
)
{
textSize
=
(
int
)
(
context
.
getResources
().
getDisplayMetrics
().
density
*
size
);
t
his
.
t
extSize
=
(
int
)
(
context
.
getResources
().
getDisplayMetrics
().
density
*
size
);
paintOuterText
.
setTextSize
(
textSize
);
paintCenterText
.
setTextSize
(
textSize
);
remeasure
();
invalidate
();
}
}
...
...
@@ -242,6 +242,7 @@ public class LoopView extends View {
this
.
initPosition
=
initPosition
;
}
}
selectedIndex
=
initPosition
;
totalScrollY
=
0
;
cancelFuture
();
invalidate
();
...
...
android/src/main/java/com/beefe/picker/view/OnSelectedListener.java
View file @
d6ad6759
...
...
@@ -8,6 +8,6 @@ import java.util.ArrayList;
public
interface
OnSelectedListener
{
void
onSelected
(
ArrayList
<
String
>
selectedList
);
void
onSelected
(
ArrayList
<
ReturnData
>
selectedList
);
}
android/src/main/java/com/beefe/picker/view/PickerViewAlone.java
View file @
d6ad6759
...
...
@@ -13,10 +13,14 @@ import java.util.ArrayList;
import
java.util.Arrays
;
/**
* Created by
heng
on 16/9/6.
* Created by
<a href="https://github.com/shexiaoheng">heng</a>
on 16/9/6.
* <p>
* Edited by heng on 16/10/09:
* 修复滚动后返回值错误的bug
*
* Edited by heng on 2016/12/26
* 1. Fixed returnData bug
* 2. Added LoopView TextColor and TextSize support
*/
public
class
PickerViewAlone
extends
LinearLayout
{
...
...
@@ -25,7 +29,7 @@ public class PickerViewAlone extends LinearLayout {
private
OnSelectedListener
onSelectedListener
;
private
ArrayList
<
String
>
curSelectedList
;
private
ArrayList
<
ReturnData
>
curSelectedList
;
public
PickerViewAlone
(
Context
context
)
{
super
(
context
);
...
...
@@ -50,19 +54,19 @@ public class PickerViewAlone extends LinearLayout {
curSelectedList
=
new
ArrayList
<>();
switch
(
array
.
getType
(
0
).
name
())
{
case
"Array"
:
setMultipleData
(
array
,
curSelectedList
,
weights
);
setMultipleData
(
array
,
weights
);
break
;
default
:
setAloneData
(
array
,
curSelectedList
);
setAloneData
(
array
);
break
;
}
}
public
ArrayList
<
String
>
getSelectedData
()
{
public
ArrayList
<
ReturnData
>
getSelectedData
()
{
return
this
.
curSelectedList
;
}
private
void
setAloneData
(
ReadableArray
array
,
final
ArrayList
<
String
>
curSelectedList
)
{
private
void
setAloneData
(
ReadableArray
array
)
{
ArrayList
<
String
>
values
=
arrayToList
(
array
);
final
LoopView
loopView
=
new
LoopView
(
getContext
());
LayoutParams
params
=
new
LayoutParams
(
...
...
@@ -71,16 +75,22 @@ public class PickerViewAlone extends LinearLayout {
loopView
.
setLayoutParams
(
params
);
loopView
.
setItems
(
values
);
loopView
.
setSelectedPosition
(
0
);
ReturnData
returnData
=
new
ReturnData
();
returnData
.
setItem
(
values
.
get
(
0
));
returnData
.
setIndex
(
loopView
.
getSelectedIndex
());
if
(
curSelectedList
.
size
()
>
0
)
{
curSelectedList
.
set
(
0
,
values
.
get
(
0
)
);
curSelectedList
.
set
(
0
,
returnData
);
}
else
{
curSelectedList
.
add
(
0
,
values
.
get
(
0
)
);
curSelectedList
.
add
(
0
,
returnData
);
}
loopView
.
setListener
(
new
OnItemSelectedListener
()
{
@Override
public
void
onItemSelected
(
String
item
,
int
index
)
{
if
(
onSelectedListener
!=
null
)
{
curSelectedList
.
set
(
0
,
item
);
ReturnData
returnData1
=
new
ReturnData
();
returnData1
.
setItem
(
item
);
returnData1
.
setIndex
(
index
);
curSelectedList
.
set
(
0
,
returnData1
);
onSelectedListener
.
onSelected
(
curSelectedList
);
}
}
...
...
@@ -88,8 +98,9 @@ public class PickerViewAlone extends LinearLayout {
pickerViewAloneLayout
.
addView
(
loopView
);
}
private
void
setMultipleData
(
ReadableArray
array
,
final
ArrayList
<
String
>
curSelectedList
,
double
[]
weights
)
{
private
void
setMultipleData
(
ReadableArray
array
,
double
[]
weights
)
{
final
String
[]
selectedItems
=
new
String
[
array
.
size
()];
final
int
[]
selectedIndexes
=
new
int
[
array
.
size
()];
for
(
int
i
=
0
;
i
<
array
.
size
();
i
++)
{
switch
(
array
.
getType
(
i
).
name
())
{
case
"Array"
:
...
...
@@ -110,10 +121,14 @@ public class PickerViewAlone extends LinearLayout {
loopView
.
setItems
(
values
);
loopView
.
setTag
(
i
);
loopView
.
setSelectedPosition
(
0
);
ReturnData
returnData
=
new
ReturnData
();
returnData
.
setItem
(
values
.
get
(
0
));
returnData
.
setIndex
(
loopView
.
getSelectedIndex
());
if
(
curSelectedList
.
size
()
>
i
)
{
curSelectedList
.
set
(
i
,
values
.
get
(
0
)
);
curSelectedList
.
set
(
i
,
returnData
);
}
else
{
curSelectedList
.
add
(
i
,
values
.
get
(
0
)
);
curSelectedList
.
add
(
i
,
returnData
);
}
selectedItems
[
i
]
=
values
.
get
(
0
);
loopView
.
setListener
(
new
OnItemSelectedListener
()
{
...
...
@@ -125,12 +140,16 @@ public class PickerViewAlone extends LinearLayout {
if
(
view
instanceof
LoopView
)
{
LoopView
loop
=
(
LoopView
)
view
;
selectedItems
[
k
]
=
loop
.
getSelectedItem
();
selectedIndexes
[
k
]
=
loop
.
getSelectedIndex
();
}
}
if
(
onSelectedListener
!=
null
)
{
for
(
int
i
=
0
;
i
<
selectedItems
.
length
;
i
++)
{
curSelectedList
.
set
(
i
,
selectedItems
[
i
]);
ReturnData
returnData1
=
new
ReturnData
();
returnData1
.
setItem
(
selectedItems
[
i
]);
returnData1
.
setIndex
(
selectedIndexes
[
i
]);
curSelectedList
.
set
(
i
,
returnData1
);
}
onSelectedListener
.
onSelected
(
curSelectedList
);
}
...
...
@@ -155,16 +174,41 @@ public class PickerViewAlone extends LinearLayout {
}
}
private
void
setSelect
(
int
size
,
String
[]
values
,
ArrayList
<
String
>
curSelectedList
)
{
private
void
setSelect
(
int
size
,
String
[]
values
,
ArrayList
<
ReturnData
>
curSelectedList
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
View
view
=
pickerViewAloneLayout
.
getChildAt
(
i
);
if
(
view
instanceof
LoopView
)
{
LoopView
loop
=
(
LoopView
)
view
;
if
(
loop
.
hasItem
(
values
[
i
]))
{
loop
.
setSelectedItem
(
values
[
i
]);
curSelectedList
.
set
(
i
,
values
[
i
]);
ReturnData
returnData
=
new
ReturnData
();
returnData
.
setItem
(
values
[
i
]);
returnData
.
setIndex
(
loop
.
getSelectedIndex
());
curSelectedList
.
set
(
i
,
returnData
);
}
}
}
}
public
void
setTextColor
(
int
color
){
int
viewCount
=
pickerViewAloneLayout
.
getChildCount
();
for
(
int
i
=
0
;
i
<
viewCount
;
i
++)
{
View
view
=
pickerViewAloneLayout
.
getChildAt
(
i
);
if
(
view
instanceof
LoopView
)
{
LoopView
loopView
=
(
LoopView
)
view
;
loopView
.
setTextColor
(
color
);
}
}
}
public
void
setTextSize
(
float
size
){
int
viewCount
=
pickerViewAloneLayout
.
getChildCount
();
for
(
int
i
=
0
;
i
<
viewCount
;
i
++)
{
View
view
=
pickerViewAloneLayout
.
getChildAt
(
i
);
if
(
view
instanceof
LoopView
)
{
LoopView
loopView
=
(
LoopView
)
view
;
loopView
.
setTextSize
(
size
);
}
}
}
...
...
android/src/main/java/com/beefe/picker/view/PickerViewLinkage.java
View file @
d6ad6759
This diff is collapsed.
Click to expand it.
android/src/main/java/com/beefe/picker/view/ReturnData.java
0 → 100644
View file @
d6ad6759
package
com.beefe.picker.view
;
/**
* Created by shexiaoheng on 2016/12/23.
*/
public
class
ReturnData
{
private
String
item
;
private
int
index
;
public
String
getItem
()
{
return
item
;
}
public
void
setItem
(
String
item
)
{
this
.
item
=
item
;
}
public
int
getIndex
()
{
return
index
;
}
public
void
setIndex
(
int
index
)
{
this
.
index
=
index
;
}
}
android/src/main/res/values/styles.xml
View file @
d6ad6759
example/PickerTest/index.js
View file @
d6ad6759
...
...
@@ -19,6 +19,7 @@ class PickerTest extends Component {
constructor
(
props
,
context
)
{
super
(
props
,
context
);
this
.
_showDatePicker
();
}
_createDateData
()
{
...
...
@@ -78,15 +79,17 @@ class PickerTest extends Component {
_showDatePicker
()
{
Picker
.
init
({
pickerData
:
this
.
_createDateData
(),
selectedValue
:
[
'
2015年
'
,
'
12月
'
,
'
12日
'
],
onPickerConfirm
:
pickedValue
=>
{
console
.
log
(
'
date
'
,
pickedValue
);
pickerToolBarFontSize
:
16
,
pickerFontSize
:
16
,
pickerFontColor
:
[
255
,
0
,
0
,
1
],
onPickerConfirm
:
(
pickedValue
,
pickedIndex
)
=>
{
console
.
log
(
'
date
'
,
pickedValue
,
pickedIndex
);
},
onPickerCancel
:
pickedValue
=>
{
console
.
log
(
'
date
'
,
pickedValue
);
onPickerCancel
:
(
pickedValue
,
pickedIndex
)
=>
{
console
.
log
(
'
date
'
,
pickedValue
,
pickedIndex
);
},
onPickerSelect
:
pickedValue
=>
{
console
.
log
(
'
date
'
,
pickedValue
);
onPickerSelect
:
(
pickedValue
,
pickedIndex
)
=>
{
console
.
log
(
'
date
'
,
pickedValue
,
pickedIndex
);
}
});
Picker
.
show
();
...
...
index.js
View file @
d6ad6759
...
...
@@ -13,17 +13,24 @@ export default {
init
(
options
){
let
opt
=
{
isLoop
:
false
,
pickerConfirmBtnText
:
'
确认
'
,
pickerCancelBtnText
:
'
取消
'
,
pickerTitleText
:
'
请选择
'
,
pickerBg
:
[
196
,
199
,
206
,
1
],
pickerToolBarBg
:
[
232
,
232
,
232
,
1
],
pickerTitleColor
:
[
20
,
20
,
20
,
1
],
pickerCancelBtnColor
:
[
1
,
186
,
245
,
1
],
pickerConfirmBtnText
:
'
confirm
'
,
pickerCancelBtnText
:
'
cancel
'
,
pickerTitleText
:
'
pls select
'
,
pickerConfirmBtnColor
:
[
1
,
186
,
245
,
1
],
pickerCancelBtnColor
:
[
1
,
186
,
245
,
1
],
pickerTitleColor
:
[
20
,
20
,
20
,
1
],
pickerToolBarBg
:
[
232
,
232
,
232
,
1
],
pickerBg
:
[
196
,
199
,
206
,
1
],
wheelFlex
:
[
1
,
1
,
1
],
pickerData
:
[],
selectedValue
:
[],
onPickerConfirm
(){},
onPickerCancel
(){},
onPickerSelect
(){},
//4.0.12 add
pickerToolBarFontSize
:
16
,
pickerFontSize
:
16
,
pickerFontColor
:
[
31
,
31
,
31
,
1
],
...
options
};
let
fnConf
=
{
...
...
@@ -36,14 +43,7 @@ export default {
//there are no `removeListener` for NativeAppEventEmitter & DeviceEventEmitter
this
.
listener
&&
this
.
listener
.
remove
();
this
.
listener
=
NativeAppEventEmitter
.
addListener
(
'
pickerEvent
'
,
event
=>
{
if
(
ios
){
fnConf
[
event
[
'
type
'
]](
event
[
'
selectedValue
'
]);
}
else
if
(
android
){
for
(
let
i
in
event
){
typeof
fnConf
[
i
]
===
'
function
'
&&
fnConf
[
i
](
event
[
i
]);
}
}
fnConf
[
event
[
'
type
'
]](
event
[
'
selectedValue
'
],
event
[
'
selectedIndex
'
]);
});
},
...
...
ios/RCTBEEPickerManager/BzwPicker.h
View file @
d6ad6759
...
...
@@ -39,6 +39,9 @@ typedef void(^backBolock)(NSDictionary * );
@property
(
strong
,
nonatomic
)
NSString
*
leftStr
;
@property
(
strong
,
nonatomic
)
NSString
*
centStr
;
@property
(
strong
,
nonatomic
)
NSString
*
rightStr
;
@property
(
strong
,
nonatomic
)
NSString
*
pickerToolBarFontSize
;
@property
(
strong
,
nonatomic
)
NSString
*
pickerFontSize
;
@property
(
strong
,
nonatomic
)
NSArray
*
pickerFontColor
;
...
...
@@ -61,6 +64,7 @@ typedef void(^backBolock)(NSDictionary * );
@property
(
strong
,
nonatomic
)
NSArray
*
weightArry
;
@property
(
assign
,
nonatomic
)
CGFloat
lineWith
;
//创建一个下角标记录是第几行 来一进来判断第一行被选中 当进来的是关联两行的逻辑的时候 或者三行关联的时候取第二行做记录
@property
(
assign
,
nonatomic
)
NSInteger
num
;
...
...
@@ -69,9 +73,12 @@ typedef void(^backBolock)(NSDictionary * );
@property
(
assign
,
nonatomic
)
NSInteger
threenum
;
@property
(
assign
,
nonatomic
)
NSInteger
seleNum
;
//用来做索引下标用
-
(
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
;
-
(
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
;
@end
ios/RCTBEEPickerManager/BzwPicker.m
View file @
d6ad6759
This diff is collapsed.
Click to expand it.
ios/RCTBEEPickerManager/RCTBEEPickerManager.m
View file @
d6ad6759
...
...
@@ -26,7 +26,11 @@ RCT_EXPORT_MODULE();
RCT_EXPORT_METHOD
(
_init
:
(
NSDictionary
*
)
indic
){
self
.
window
=
[[
UIApplication
sharedApplication
].
windows
lastObject
];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[[
UIApplication
sharedApplication
].
keyWindow
endEditing
:
YES
];
});
self
.
window
=
[
UIApplication
sharedApplication
].
keyWindow
;
NSString
*
pickerConfirmBtnText
=
indic
[
@"pickerConfirmBtnText"
];
NSString
*
pickerCancelBtnText
=
indic
[
@"pickerCancelBtnText"
];
...
...
@@ -38,6 +42,9 @@ RCT_EXPORT_METHOD(_init:(NSDictionary *)indic){
NSArray
*
pickerBg
=
indic
[
@"pickerBg"
];
NSArray
*
selectArry
=
indic
[
@"selectedValue"
];
NSArray
*
weightArry
=
indic
[
@"wheelFlex"
];
NSString
*
pickerToolBarFontSize
=
[
NSString
stringWithFormat
:
@"%@"
,
indic
[
@"pickerToolBarFontSize"
]];
NSString
*
pickerFontSize
=
[
NSString
stringWithFormat
:
@"%@"
,
indic
[
@"pickerFontSize"
]];
NSArray
*
pickerFontColor
=
indic
[
@"pickerFontColor"
];
id
pickerData
=
indic
[
@"pickerData"
];
...
...
@@ -62,7 +69,8 @@ RCT_EXPORT_METHOD(_init:(NSDictionary *)indic){
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
];
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
];
_pick
.
bolock
=^
(
NSDictionary
*
backinfoArry
){
...
...
package.json
View file @
d6ad6759
{
"name"
:
"react-native-picker"
,
"version"
:
"4.0.1
1
"
,
"version"
:
"4.0.1
2
"
,
"description"
:
""
,
"main"
:
"index.js"
,
"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