這篇文章主要介紹“react-natie刪除提示如何實(shí)現(xiàn)”,在日常操作中,相信很多人在react-natie刪除提示如何實(shí)現(xiàn)問題上存在疑惑,小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對(duì)大家解答”react-natie刪除提示如何實(shí)現(xiàn)”的疑惑有所幫助!接下來(lái),請(qǐng)跟著小編一起來(lái)學(xué)習(xí)吧!
成都創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比雙橋網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫(kù),直接使用。一站式雙橋網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋雙橋地區(qū)。費(fèi)用合理售后完善,十余年實(shí)體公司更值得信賴。
react-natie刪除提示的實(shí)現(xiàn)方法:1、通過“import React from 'react';”引入react;2、通過“ showConfirm=()=>{Alert.alert('','除',[{text:'',onPress:() => Alert.alert("") },{text:'',style:'cancel'}],{...}”方法實(shí)現(xiàn)刪除確認(rèn)框即可。
react native 彈框和刪除確認(rèn)框

import React from 'react';
import {
Alert,Button,View,Text,TouchableOpacity,StyleSheet
} from 'react-native';
export default class App extends React.Component{
showAlert=()=>{
Alert.alert("點(diǎn)擊了彈出框")
};
showConfirm=()=>{
Alert.alert('警告','確認(rèn)刪除',[
{text:'確認(rèn)',onPress:() => Alert.alert("點(diǎn)擊了確認(rèn)") },
{text:'取消',style:'cancel'}
],{cancelable:false});
};
render(){
return (
<View style={styles.container}>
<View style={styles.buttonView}><Button onPress={this.showAlert} title={"點(diǎn)擊顯示alert"} /></View>
<View style={styles.buttonView}><Button onPress={this.showConfirm} title={"點(diǎn)擊顯示確認(rèn)框"} /></View>
</View>
)
}
}
const styles=StyleSheet.create({
container:{
marginTop:20,
marginHorizontal:10
},
buttonView:{
margin: 10,
height: 40
}
});
到此,關(guān)于“react-natie刪除提示如何實(shí)現(xiàn)”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)?lái)更多實(shí)用的文章!
分享文章:react-natie刪除提示如何實(shí)現(xiàn)
本文URL:http://www.chinadenli.net/article46/pecheg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計(jì)、、網(wǎng)站收錄、網(wǎng)頁(yè)設(shè)計(jì)公司、網(wǎng)站排名、建站公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)