Clipboard

Clipboard

Clipboard gives you an interface for setting and getting content from Clipboard on both iOS and Android

Methods

static getString()

Get content of string type, this method returns a Promise, so you can use following code to get clipboard content

async _getContent() {
  var content = await Clipboard.getString();
}

static setString(content)

Set content of string type. You can use following code to set clipboard content

_setContent() {
  Clipboard.setString('hello world');
}

@param the content to be stored in the clipboard.

© 2015–2017 Facebook Inc.
Licensed under the Creative Commons Attribution 4.0 International Public License.
https://facebook.github.io/react-native/docs/clipboard.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部