1.1.0 • Published 4 years ago

react-native-tvtouchablescale v1.1.0

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

react-native-TVTouchableScale

一款纯JS开发的react-native TV端触控组件

如何安装

yarn add react-native-tvtouchablescale

or

npm i --save react-native-tvtouchablescale

如何使用

import TVTouchableScale from 'react-native-tvtouchablescale'

export default function(props) {
    return (
        <TVTouchableScale
            autoFocus={true}
            style={{width:50,height:50,backgroundColor:'red'}}
        >
            <Text>Hello World!</Text>
        </TVTouchableScale>
    )
}

示例

API

PropTypeDescriptionDefault
styleObject样式true
scaleNumber放大比例1.1
focusStyleObject聚焦时的样式
getRefFunction用于获取Dom的ref
onPressFunction点击事件
onFocusFunction聚焦事件
onBlurFunction失焦事件
autoFocusBoolean是否自动聚焦false
prohibitDisabledArray禁用特定的聚焦方向
prohibitTargetArray指定特定方向聚焦的Dom
hideDisabledAnimationBoolean是否去除抖动动画
eventHandlerFunction监听遥控器事件
eventDisabledFunction监听触发禁用方向事件