美文网首页
Alert.alert()和alert()和Prompt和Ale

Alert.alert()和alert()和Prompt和Ale

作者: 考拉小姐_zzzZZZ | 来源:发表于2017-02-10 13:45 被阅读235次
alert('报名时间已过!');
Paste_Image.png
  Alert.alert(

                            "标题标题",

                            "内容内容内容内容内容内容内容内容内容内容"

);
Paste_Image.png
  Alert.alert(

                            "标题标题",

                            "内容内容内容内容内容内容内容内容内容内容"
,
 [
        {text: "取消"/*, onPress: () => console.log('Cancel Pressed!')*/},
 
       {text:"确定", onPress: () => console.log('OK!')}
    
]);
Paste_Image.png

点击确认按钮
控制台打印

Paste_Image.png
<Prompt
   
 title={message}
   
 cancelText="取消"
  
  submitText="好"
  
  visible={ this.state.promptVisible }
   
 onCancel={ () => this.setState({
      
  promptVisible: false,
   
     message: "You cancelled"
   
 }) }
   
 onSubmit={ (value) => {
    
    this.setState({
      
      promptVisible: false,
     
       message: `You said "${value}"`
    
    });
     
   this.saveResponse(value);
    }

    }/>
Paste_Image.png
  AlertIOS.alert('网络已断开,请设置网络')
屏幕快照 2017-02-13 下午4.12.30.png
        AlertIOS.alert('提示', '当前处于移动网络状态,是否继续播放?', [
            {
                text: '取消播放',
                onPress: function () {
                    
                }
            },
            {
                text: '继续播放',
                onPress: function () {
                    
                }
            }
        ])
屏幕快照 2017-02-13 下午4.14.40.png

相关文章

网友评论

      本文标题:Alert.alert()和alert()和Prompt和Ale

      本文链接:https://www.haomeiwen.com/subject/zwpgittx.html