从 react-native 0.63.4 升级到 0.64.0
我的步骤:
npx react-native run-android 到版本 0.64.0 - 这一步成功了2. npx react-native upgrade- 这一步成功了
npx react-native run-android- 此步骤失败,出现以下2 个错误:顺便说一句,在 iOS 模拟器上一切正常。
我发现它TextInput的内容不是垂直居中的(在一些像HUAWEI这样的安卓设备中),当它TextInput的父样式是{flexDirection: 'row'},它看起来像是基线是中心,文字更高.
当我尝试在Android设备中运行react-native应用程序时遇到问题.即使我确定它已连接,设备也会连接.
adb设备
附加设备列表
HMNBBCE6A2826109器件
设备:华为Y2 Android版本:5.1调试模式:enbaled服务器正在运行.当我跑
react-native run-android
我收到这个错误
无法在设备上安装应用程序,请阅读上面的错误以获取详细信息.确保运行Android模拟器或连接设备并设置Android开发环境:https: //facebook.github.io/react-native/docs/android-setup.html
我的导航栏中有一个菜单图标,需要将其用作菜单。
我正在尝试使用react-native-popup-menu lib 实现此目的。
该组件<MenuTrigger />仅接受文本(字符串)作为属性。
如何使用图标作为菜单触发器?
朋友,我将采用一个“父母视图”,而在视图内部则采用一个“ TouchableOpacity”。我将在主视图上添加panResponder,当触摸主视图时,它可以正常工作。但是TouchableOpacity无法正常工作,我想删除TouchableOpacity上的panResponder。这样TouchableOpacity就可以了。
代码:
this._panResponder = PanResponder.create({
// Ask to be the responder:
onStartShouldSetPanResponder: (evt, gestureState) => true,
onStartShouldSetPanResponderCapture: (evt, gestureState) => true,
onMoveShouldSetPanResponder: (evt, gestureState) => true,
onMoveShouldSetPanResponderCapture: (evt, gestureState) => true,
onPanResponderGrant: (evt, gestureState) => {
// The gesture has started. Show visual feedback so the user knows
// what is happening!
// gestureState.d{x,y} will be set to zero now
// this.toggleModal()
},
onPanResponderMove: (evt, gestureState) => {
// The most recent move distance is gestureState.move{X,Y}
// The accumulated …Run Code Online (Sandbox Code Playgroud) reactjs react-native react-native-android react-native-ios react-native-0.46
我收到这个错误:
开发服务器返回响应404.找不到条目文件index.js.
这是我的文件夹结构:
的package.json
{
"name": "vepo",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"rnpm": {
"assets": [
"./app/fonts"
]
},
"jest": {
"preset": "react-native",
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
"\\.(css|less)$": "<rootDir>/__mocks__/styleMock.js"
}
},
"dependencies": {
"flow-typed": "^2.0.0",
"generator-rn-toolbox": "^2.2.0",
"imagemagick": "^0.1.3",
"immutable": "^3.8.1",
"native-base": "2.3.0",
"prop-types": "^15.5.10",
"react": "16.0.0",
"react-native": "0.50.3",
"react-native-aws3": "^0.0.8",
"react-native-blur": "^3.1.3",
"react-native-communications": "^2.2.1",
"react-native-drawer": "^2.3.0",
//"react-native-fbsdk": "git://github.com/facebook/react-native-fbsdk#065507aa1d2b8b0b6cb50d13117694123f8303fa",
"react-native-git-upgrade": "^0.2.7",
"react-native-image-picker": "^0.26.4",
"react-native-interactable": "^0.1.2",
"react-native-mail": "^3.0.2",
"react-native-maps": "^0.16.4",
"react-native-modal": "^2.3.2",
"react-native-modalbox": …Run Code Online (Sandbox Code Playgroud) 我在我的应用程序中使用了材料下拉列表
<Dropdown
baseColor='white'
itemColor='white'
label='Select Cluster'
/>
Run Code Online (Sandbox Code Playgroud)
我像这样获取JSON对象,它工作正常.
fetch('url', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
username : "admin"
})
}).then((response) => response.json())
.then((responseJson) => {
var count = Object.keys(responseJson.message.Obj).length;
for(var i=0;i<count;i++){
console.log(responseJson.message.Obj[i].name) // I need to add
//these names to dropdown
}
})
.catch((error) => {
console.error(error);
});
Run Code Online (Sandbox Code Playgroud)
现在我需要将
responseJson.message.Obj[i].name值添加到我的下拉列表中.
javascript react-native react-native-android react-native-ios
我在react-native中使用"WebView"来呈现网页.该网页没有适合移动设备的用户界面.
当我在Chrome浏览器中打开它时,它看起来如下所示.而且我想要下面这样
但是当我在代码下面渲染时,它看起来像下面显示的图像.请参阅我已经尝试了不同的道具automaticallyAdjustContentInsets = {false},scalesPageToFit={false}.但它没有给我欲望输出.
render(){
const URL = "https://stellarterm.com";
return(
<WebView
source={{URL}}
/>
Run Code Online (Sandbox Code Playgroud)
结果
如果有,请随时提出任何解决方案.任何第三方图书馆也都可以.
我正在尝试上传base64图像并设置消息,标题和标题,这似乎不起作用,基本上发生的情况是该图像已上传,但其余参数被忽略。有什么帮助吗?
这是代码的一部分
const shareOptions = {
title: "React Native",
message: "Hola mundo",
url: result,
subject: "Share Link"
}
....
Share.open(shareOptions)
Run Code Online (Sandbox Code Playgroud)
我也试图分享到电子邮件结束消息和标题被填充。Facebook有一些限制吗?
我花了大约5个小时来尝试使它与许多不同的代码排列一起使用,然后进行重建。我一生都无法将默认的“红色指针”标记更改为React Native Maps中的默认标记图像。
import MapView, { PROVIDER_GOOGLE } from 'react-native-maps';
...
<MapView
provider={PROVIDER_GOOGLE}
style={styles.map}
ref={ref => {this.map = ref;}}
minZoomLevel={4} // default => 0
maxZoomLevel={10} // default => 20
enableZoomControl={true}
showsUserLocation = {true}
showsMyLocationButton = {true}
zoomEnabled = {true}
initialRegion={{
latitude: 37.600425,
longitude: -122.385861,
latitudeDelta: LATITUDE_DELTA,
longitudeDelta: LONGITUDE_DELTA,
}}
>
<MapView.Marker
coordinate={marker.location}
image={require('./images/test.png')} <------ HERE
width={48}
height={48}
/>
</MapView>
Run Code Online (Sandbox Code Playgroud)
图像肯定存在于正确的文件夹中,我尝试了不同的图像格式png / gif / jpg / svg,尝试使用了{{uri:...}}和icon/image,添加和删除了width / height属性。似乎没有任何作用。我总是得到默认的红色指针。
我错过了明显的事情吗?
如果require映像不存在或类型不受支持,则项目打包程序/编译器将失败。它绝对可以看到图像,但是对此不做任何事情。在仿真器和实际设备上,结果相同。
image={require('./images/test.png')}
这条线什么也不做,好像它被某种方式忽略了一样。
google-maps-markers react-native react-native-android react-native-maps