小编ede*_*den的帖子

使用photoshop脚本保存png不起作用

if (app.documents.length != 0) {
    var doc= app.activeDocument;

    for (i = 0; i < 5; i++) {
        var layer = doc.artLayers[0]
        layer.textItem.contents = i;

        var pngFile    = new File("/Users/dlokshin/temp/" + i + ".png");
        pngSaveOptions = new PNGSaveOptions();
        pngSaveOptions.interlaced = false;
        doc.saveAs(pngFile, pngSaveOptions, true, Extension.LOWERCASE);
    }
}
Run Code Online (Sandbox Code Playgroud)

每当我运行上面的脚本时,不是将文件保存为1.png,2.png,3.png等,而是打开保存对话框并提示我输入文件名并单击保存.我究竟做错了什么?

javascript photoshop-script

5
推荐指数
1
解决办法
6730
查看次数

如何将输入字段数据从Modal传递到react-Native中的Container?

这是我正在使用的:

<Modal
    visible = {this.props.visible}
    animationType="slide"
    transparent
    onRequestClose={() => {}} >
         <TextInput 
           style = {styles.inputBox}
           ref = {this.props.destinatinon} />
   </Modal>
Run Code Online (Sandbox Code Playgroud)

在容器中

 <ExampleModal
       destination = {this.state.destination} >
     </ExampleModal>
Run Code Online (Sandbox Code Playgroud)

我不知道如何将数据从Modal传递给Parent Component.任何类型的教程或链接都可以.提前致谢.

javascript reactjs react-native

5
推荐指数
1
解决办法
3960
查看次数