Toggle navigation
Toggle navigation
This project
Loading...
Sign in
mobile
/
YH_RNComponent
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
chenl
8 years ago
Commit
caf7cd4dc0a8329736616069ba5f72098b4ff44c
1 parent
19013138
修改了筛选的样式,增加了SearchBar的android兼容。
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
5 deletions
js/brandStore/components/brandStore/brandStoreSubView/Cells/ProductCategoryList.js
js/common/components/YH_SearchBar.js
js/brandStore/components/brandStore/brandStoreSubView/Cells/ProductCategoryList.js
View file @
caf7cd4
...
...
@@ -129,7 +129,7 @@ let styles = StyleSheet.create({
backgroundColor
:
'#ffffff'
,
borderTopColor
:
'#e0e0e0'
,
borderLeftColor
:
'#ffffff'
,
borderBottomColor
:
'#
e0e0e0
'
,
borderBottomColor
:
'#
ffffff
'
,
borderWidth
:
0.5
,
},
leftContentContainer
:
{
...
...
js/common/components/YH_SearchBar.js
View file @
caf7cd4
import
React
from
'react'
;
import
ReactNative
from
'react-native'
;
import
{
Platform
}
from
'react-native'
;
const
{
PropTypes
,
...
...
@@ -12,6 +13,8 @@ const {
const
YH_SearchBarView
=
ReactNative
.
requireNativeComponent
(
'YH_SearchBarView'
,
null
);
var
UIManager
=
require
(
'UIManager'
);
export
default
class
YH_SearchBar
extends
Component
{
static
propTypes
=
{
placeholder
:
PropTypes
.
string
,
...
...
@@ -59,15 +62,40 @@ export default class YH_SearchBar extends Component {
}
blur
()
{
return
NativeModules
.
YH_SearchBarViewManager
.
blur
(
ReactNative
.
findNodeHandle
(
this
));
if
(
Platform
.
OS
===
'ios'
)
{
return
NativeModules
.
YH_SearchBarViewManager
.
blur
(
ReactNative
.
findNodeHandle
(
this
));
}
else
{
return
UIManager
.
dispatchViewManagerCommand
(
ReactNative
.
findNodeHandle
(
this
),
UIManager
.
YH_SearchBarView
.
Commands
.
blur
,
null
);
}
}
focus
()
{
return
NativeModules
.
YH_SearchBarViewManager
.
focus
(
ReactNative
.
findNodeHandle
(
this
));
if
(
Platform
.
OS
===
'ios'
)
{
return
NativeModules
.
YH_SearchBarViewManager
.
focus
(
ReactNative
.
findNodeHandle
(
this
));
}
else
{
return
UIManager
.
dispatchViewManagerCommand
(
ReactNative
.
findNodeHandle
(
this
),
UIManager
.
YH_SearchBarView
.
Commands
.
focus
,
null
);
}
}
unFocus
()
{
return
NativeModules
.
YH_SearchBarViewManager
.
unFocus
(
ReactNative
.
findNodeHandle
(
this
));
if
(
Platform
.
OS
===
'ios'
)
{
return
NativeModules
.
YH_SearchBarViewManager
.
unFocus
(
ReactNative
.
findNodeHandle
(
this
));
}
else
{
return
UIManager
.
dispatchViewManagerCommand
(
ReactNative
.
findNodeHandle
(
this
),
UIManager
.
YH_SearchBarView
.
Commands
.
unFocus
,
null
);
}
}
render
()
{
...
...
@@ -80,7 +108,6 @@ export default class YH_SearchBar extends Component {
onEndEditing
=
{
this
.
_onEndEditing
}
onTextChange
=
{
this
.
_onTextChange
}
onClickCancel
=
{
this
.
_onClickCancel
}
/
>
);
}
...
...
Please
register
or
login
to post a comment