Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nuke-touchable

Package Overview
Dependencies
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuke-touchable

可点击容器

  • 2.3.9
  • npm
  • Socket score

Version published
Weekly downloads
9
decreased by-25%
Maintainers
2
Weekly downloads
 
Created
Source

Touchable

  • category: Components
  • chinese: 可点击容器
  • type: 基本

设计思路

Touchable 通常用于定义带 press 事件的容器,例如按钮等。

API

属性说明类型默认值
onPress点击事件function(e)
onLongPress长按事件,仅 nativefunction(e)
activeStyle手指按下时的样式object
style样式object
rippleEnabled是否在安卓端启用水波纹效果,水波纹效果只对 backgroundColor 的改变有效, 对 backgroundImage 线性渐变无效。且组件必须监听 onPress 事件。false

注意: 水波纹效果是安卓 Material Design 设计规范中的基础动效,具备安卓端特性, iOS 端不支持。

使用示例:

<Touchable
  style={styles.btn}
   activeStyle={styles.btnActive}
   rippleEnabled={true}
    onPress={()=>{}}
>
  <Text style={styles.btnText}>Hello Nuke</Text>
</Touchable>

const styles ={
  btn: {
    height:88,
    backgroundColor:'#ffffff',
    color:'#f44336',
    borderWidth:2,
    borderStyle:'solid',
    borderColor:'#f44336',
    justifyContent:'center',
    alignItems:'center'
  },
  btnText:{
    color:'#f44336',
  },
  btnActive: {
    backgroundColor:'#f44336'
  }
}

其他

  • bug、建议联系 @翊晨
  • 钉钉交流群

Keywords

FAQs

Package last updated on 26 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc