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
6c3cba06
Commit
6c3cba06
authored
Jan 14, 2016
by
xwenliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add examples
parent
6240fbfa
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5456 additions
and
1 deletion
+5456
-1
README.md
README.md
+6
-0
demo/area-picker.js
demo/area-picker.js
+5395
-0
demo/date-picker.js
demo/date-picker.js
+54
-0
package.json
package.json
+1
-1
No files found.
README.md
View file @
6c3cba06
...
...
@@ -6,6 +6,12 @@ It was most likely an example of how to build a cross-platform Picker Component
Needs react-native >= 0.14.2
####Demo
-
<b>
[
Date-picker
](
./demo/date-picker.js
)
</b>
-
<b>
[
Area-picker
](
./demo/area-picker.js
)
</b>


...
...
demo/area-picker.js
0 → 100644
View file @
6c3cba06
This diff is collapsed.
Click to expand it.
demo/date-picker.js
0 → 100644
View file @
6c3cba06
'
use strict
'
;
import
React
from
'
react-native
'
;
import
Picker
from
'
react-native-picker
'
;
function
createDateData
(){
let
date
=
{};
for
(
let
i
=
1950
;
i
<
2050
;
i
++
){
let
month
=
{};
for
(
let
j
=
1
;
j
<
13
;
j
++
){
let
day
=
[];
if
(
j
===
2
){
for
(
let
k
=
1
;
k
<
29
;
k
++
){
day
.
push
(
k
+
'
日
'
);
}
}
else
if
(
j
in
{
1
:
1
,
3
:
1
,
5
:
1
,
7
:
1
,
8
:
1
,
10
:
1
,
12
:
1
}){
for
(
let
k
=
1
;
k
<
32
;
k
++
){
day
.
push
(
k
+
'
日
'
);
}
}
else
{
for
(
let
k
=
1
;
k
<
31
;
k
++
){
day
.
push
(
k
+
'
日
'
);
}
}
month
[
j
+
'
月
'
]
=
day
;
}
date
[
i
+
'
年
'
]
=
month
;
}
return
date
;
};
export
default
class
DatePicker
extends
React
.
Component
{
toggle
(){
this
.
picker
.
toggle
();
}
render
(){
return
(
<
Picker
ref
=
{
picker
=>
this
.
picker
=
picker
}
pickerHeight
=
{
300
}
showDuration
=
{
300
}
pickerData
=
{
this
.
props
.
pickerData
||
createDateData
()}
selectedValue
=
{
this
.
props
.
selectedValue
}
onPickerDone
=
{(
pickedValue
)
=>
{
this
.
props
.
onPickerDone
&&
this
.
props
.
onPickerDone
(
pickedValue
);
}}
/
>
);
}
};
\ No newline at end of file
package.json
View file @
6c3cba06
{
"name"
:
"react-native-picker"
,
"version"
:
"0.3.
2
"
,
"version"
:
"0.3.
3
"
,
"description"
:
"react-native-picker"
,
"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