PIXNET Logo登入

碎碎念

跳到主文

murmur

部落格全站分類:財經政論

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 7月 08 週一 201921:56
  • [RN][轉] React.js Search搜尋功能使用過濾迴圈 filter()

轉自 www.ucamc.com/e-learning/javascript/276-react-js-search搜尋功能使用過濾迴圈filter.html
--
 
filter函數特性:
(繼續閱讀...)
文章標籤

dizzy03 發表在 痞客邦 留言(0) 人氣(3)

  • 個人分類:Programming
▲top
  • 7月 08 週一 201921:54
  • [RN] Difference between onChange vs onChangeText of TextInput


onChangeText is basically a simplified version of onChange, so you can easily use it, without the hassle of going through event.target.value to get changed value.
So, when should you use onChange and when onChangeText?
If you have simple form with few textinputs, or simple logic, you can go straight away and use onChangeText
<TextInput value={this.state.name} onChangeText={(text) => this.setState({name: text})}>

If you have more complicated forms and/or you have more logic in handling data (like handling text differently from number) when user changes input, then you are better of with onChange, because it gives you more flexibility. For example:
handleChange(event) {
const {name, type, value} = event.nativeEvent;
let processedData = value;
if(type==='text') {
processedData = value.toUpperCase();
} else if (type==='number') {
processedData = value * 2;
}
this.setState({[name]: processedData})
}
<TextInput name="username" type="text" value={this.state.username} onChange={this.handleChange}}>
<TextInput name="password" type="number" value={this.state.password} onChange={this.handleChange}}>

(繼續閱讀...)
文章標籤

dizzy03 發表在 痞客邦 留言(0) 人氣(1)

  • 個人分類:Programming
▲top
  • 7月 08 週一 201916:00
  • [RN][轉] 同時兼容iOS與Android的Toast組件

示例圖
轉自 bbs.reactnative.cn/topic/444/同时兼容ios与android的toast组件
--
給大家安利一款可以在iOS和Android上通用的Toast組件: react-native-root-toast
現在開源的Toast組件一大堆,為什麼要選用這個呢?原因如下:
(繼續閱讀...)
文章標籤

dizzy03 發表在 痞客邦 留言(0) 人氣(0)

  • 個人分類:Programming
▲top
  • 7月 05 週五 201911:46
  • [RN][轉] React Native FlatList 多選效果

96
轉自 https://www.jianshu.com/p/e9144208f18f
--
 
(繼續閱讀...)
文章標籤

dizzy03 發表在 痞客邦 留言(0) 人氣(0)

  • 個人分類:Programming
▲top
  • 6月 27 週四 201910:09
  • [steam] Super Naughty Maid 2

遊戲本體
https://store.steampowered.com/app/1097880/Super_Naughty_Maid_2/
 
(繼續閱讀...)
文章標籤

dizzy03 發表在 痞客邦 留言(0) 人氣(55)

  • 個人分類:ACG
▲top
  • 6月 26 週三 201914:49
  • [RN][react-navigation] header按鈕onPress的function未定義function is undefined on headerLeft button onPress

問題:
使用react-navigation接收navigation帶回來的參數,並且在navigationOptions中定義header區塊按鈕onPress時呼叫自訂function時,會直接出現"function is undefined"的錯誤訊息。
EX:
static navigationOptions = ({ navigation }) => ({
      headerRight: <RightButton onPress={() => this.removeVehicle()} />
})
(繼續閱讀...)
文章標籤

dizzy03 發表在 痞客邦 留言(0) 人氣(0)

  • 個人分類:Programming
▲top
  • 6月 25 週二 201915:45
  • [RN] 如何在按鈕上面增加ICON - How to model a button with icons in react-native

答:
1. 使用react-native-vector-icons 
<Icon name="facebook" style={styles.icon}>
<Text style={styles.text}>Login with Facebook</Text>
</Icon>

(繼續閱讀...)
文章標籤

dizzy03 發表在 痞客邦 留言(0) 人氣(0)

  • 個人分類:Programming
▲top
  • 6月 25 週二 201915:26
  • [RN] 如何隱藏/顯示元件 - Hide/Show components in react native

答:
1. state設一個變數存true / false
2. 把if else判斷獨立成一個function,裏頭判斷變數是true就return內容,false就return null。
3. 在render的return中呼叫這個function,要不要顯示元件,控制state這個變數就好。
(繼續閱讀...)
文章標籤

dizzy03 發表在 痞客邦 留言(0) 人氣(2)

  • 個人分類:Programming
▲top
  • 6月 25 週二 201914:38
  • [RN] 如何移除陣列元素 - Delete item from state array in react

問:
The story is, I should be able to put Bob, Sally and Jack into a box. I can also remove either from the box. When removed, no slot is left.
 
people = ["Bob", "Sally", "Jack"]
(繼續閱讀...)
文章標籤

dizzy03 發表在 痞客邦 留言(0) 人氣(0)

  • 個人分類:Programming
▲top
  • 6月 25 週二 201914:10
  • [RN] 如何動態給TextInput的值 - How to assign value dynamically to TextInput using react native

RN下的取得input value方法跟平常JS不一樣,以往都是全部輸入完成後才去把值抓出來。
而在RN下資料和顯示基本上是連動的,input的value就對應到某個state變數,當value改變時其變數也一起改變,反之亦然。
 
TextInput要取值必須在onChangeText屬性中去取,取出來寫入某個state中某個變數,也就是在文字輸入時就一併變動,沒有事後再取值這回事。
(繼續閱讀...)
文章標籤

dizzy03 發表在 痞客邦 留言(0) 人氣(0)

  • 個人分類:Programming
▲top
«1...444546130»

熱門文章

  • (59)Ggfff
  • (228)[轉] 台鐵火車座位配置,讓你拿到票就知道靠窗還是靠道
  • (891)[Windows] 視窗最大化後發生視窗頂部或最下方出現黑色/白色/灰色空間
  • (405)[轉] 5 個免費 Bilibili 影片下載免安装線上工具推薦!
  • (524)國光號 中興號座位表
  • (501)[Word] Word「第幾頁,共幾頁」選項怎麼不見了? 其實在這裡啦~~
  • (392)[Windows] 如何將iCloud 照片 預設資料夾位置從C槽改為D槽
  • (116)[Windows] (解決)請問win10怎麼刪除微軟注音輸入法的『全形』只要『半形』
  • (90)[excel] Excel 凍結窗格、鎖定欄或列教學,固定標題不捲動
  • (63)[PhpSpreadsheet] PhpSpreadsheet設定儲存格框線樣式 Styling cell borders with PhpSpreadsheet PHP

文章精選

文章搜尋

文章分類

  • 旅遊 (3)
  • AI (2)
  • pixnet (1)
  • 騎士公主 (2)
  • 幹!MafiaWars (14)
  • 神馬三國 (39)
  • DSLR (15)
  • News (9)
  • Finance (65)
  • Estate (4)
  • Windows (78)
  • Programming (481)
  • Nihongo (18)
  • Murmur (176)
  • Application (87)
  • 3C (31)
  • Health (65)
  • ACG (73)
  • Life (111)
  • 未分類文章 (1)

最新文章

  • [轉] 短期交易是零和賽局
  • [轉] 3M WP4000 即淨高效濾水壺,第2代大升級!!3道過濾、1.4公升加大過濾容量、無須更換電池!
  • 健康存摺APP如何看X光片?
  • X.com 網頁版卡住錯誤排除
  • 我想在辦公室泡濾掛式咖啡加牛奶,但是沒有冰箱,有甚麼替代的方式? 2026-01-16更新感想
  • [AI] 物理小問題
  • [AI] 受管理的泡沫
  • [AI] 血壓計的原理
  • [AI] grok image有辦法查找產圖的歷史紀錄嗎? 包含提示詞
  • [轉] 關於在高山上失溫,27個您一定要知道的重點

參觀人氣

  • 本日人氣:
  • 累積人氣:

GoogleAdsense