原创 react native中數組和key值
Warning:Each child in an array or iterator should have a unique “key” prop. 解決方法:在數組名.map等循環子項中添加key屬性 array.map((valu
原创 將本地項目push到github
新建的或者很久的項目、文件 push到github託管首先你要再github上創建一個託管代碼的倉庫!1.工具 git 命令行 。安裝git. 右擊該項目,打開 Git Bash.2.添加遠程已創建的倉庫3.4.5.如果出現錯誤再次
原创 npm安裝react native組件出錯
使用npm安裝rn組件,報錯。使用yarn add 也失敗。 If you are behind a proxy, please make sure that the npm ERR! network ‘proxy’ config
原创 React Native中View絕對定位absolute居中問題
讓一個view垂直居中 position: 'absolute', right:0, marginBottom: "auto", marginTop:"auto", height:300, 垂直居中要給h
原创 React Native封裝原生組件發佈到npm
因爲一個任務,要寫原生的獲取用戶手機文件夾,實現用戶自定義文件夾的功能,寫好了之後嘗試封裝成組件。1. 首先,有一個rn項目,用Adnroid Studio打開 android -> app -> build.gradle如圖新建一個 A
原创 react native的ScrollView滑動到指定位置
情景:Modal做的選擇彈出框,傳入用戶可選擇的數據源,用戶選擇之一,下次點開時,自動到當前選擇的參數位置附近,方便用戶調整 <Modal .....> <View ..> <ScrollView style={{marginTop
原创 adb devices找不到設備
adb devices找不到設備 前幾天都是好的,今天adb devices突然就找不到設備了,作爲移動開發小白,連不上手機很難熬。無論重啓還是關機,都於事無補。 解決 1.打開 設備管理器,(要連接手機)找到Android Com