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
2e6c425e
Commit
2e6c425e
authored
Jan 17, 2016
by
xwenliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify example
parent
43d94ed3
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
5377 deletions
+68
-5377
demo/area-picker.js
demo/area-picker.js
+45
-5365
demo/date-picker.js
demo/date-picker.js
+23
-12
No files found.
demo/area-picker.js
View file @
2e6c425e
This diff is collapsed.
Click to expand it.
demo/date-picker.js
View file @
2e6c425e
'
use strict
'
;
'
use strict
'
;
import
React
,
{
View
,
Text
,
TouchableOpacity
,
Dimensions
}
from
'
react-native
'
;
import
React
from
'
react-native
'
;
import
Picker
from
'
react-native-picker
'
;
import
Picker
from
'
react-native-picker
'
;
function
createDateData
(){
function
createDateData
(){
...
@@ -33,22 +39,27 @@ function createDateData(){
...
@@ -33,22 +39,27 @@ function createDateData(){
export
default
class
DatePicker
extends
React
.
Component
{
export
default
class
DatePicker
extends
React
.
Component
{
togg
le
(){
_onPressHand
le
(){
this
.
picker
.
toggle
();
this
.
picker
.
toggle
();
}
}
render
(){
render
(){
return
(
return
(
<
Picker
<
View
style
=
{{
height
:
Dimensions
.
get
(
'
window
'
).
height
}}
>
ref
=
{
picker
=>
this
.
picker
=
picker
}
<
TouchableOpacity
style
=
{{
marginTop
:
20
}}
onPress
=
{
this
.
_onPressHandle
.
bind
(
this
)}
>
pickerHeight
=
{
300
}
<
Text
>
点我
<
/Text
>
showDuration
=
{
300
}
<
/TouchableOpacity
>
pickerData
=
{
this
.
props
.
pickerData
||
createDateData
()}
<
Picker
selectedValue
=
{
this
.
props
.
selectedValue
}
ref
=
{
picker
=>
this
.
picker
=
picker
}
onPickerDone
=
{(
pickedValue
)
=>
{
pickerHeight
=
{
320
}
this
.
props
.
onPickerDone
&&
this
.
props
.
onPickerDone
(
pickedValue
);
showDuration
=
{
300
}
}}
pickerData
=
{
createDateData
()}
/
>
selectedValue
=
{[
'
2015年
'
,
'
12月
'
,
'
12日
'
]}
onPickerDone
=
{(
pickedValue
)
=>
{
console
.
log
(
pickedValue
);
}}
/
>
<
/View
>
);
);
}
}
};
};
\ No newline at end of file
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