有没有人在 Android 和 iOS 的 React Native 应用程序中集成了 twitter 登录。任何帮助都受到高度赞赏。
react-native twitter-login react-native-android react-native-ios
当我打开配置文件选项卡时,它会从 URL 加载图像(配置文件图像),如果用户想要更改他的图像,他可以,但是当他更改图像时,服务器上的图像已更改,但在应用程序上它不会更改,但如果我刷新了它确实改变的应用程序。
当用户登录他在 URL 上有图像时,URL 不会改变,当他更新图像时,URL 是相同的,但图片是不同的。
<Image style={{height: 70, width:70,borderRadius: 35}} source={{uri:'http://********************/'+GLOBAL.api_token}} />
Run Code Online (Sandbox Code Playgroud) android react-native react-native-android react-native-ios react-native-image
我试图在图像上放置一个图标,但它所做的只是将图像向下推到页面上。
这是它目前的样子:
如您所见,我正在尝试将蓝色后退箭头放在该图像的顶部。
这是我的标记的样子:
<ScrollView style={ styles.container }>
<View style={ styles.coverImageContainer }>
<Image
style={ styles.coverImage }
source={ require('./img.jpg') }
>
<View>
<Ionicons name="ios-arrow-back" color="#4F8EF7" size={25} />
</View>
</Image>
</View>
...
Run Code Online (Sandbox Code Playgroud)
这是我的风格:
container: {
backgroundColor: '#f9f9f9',
flex: 1,
},
coverImageContainer: {
backgroundColor: '#000',
},
coverImage: {
width: null,
height: 170,
resizeMode: 'cover',
opacity: 0.7,
flex: 1,
},
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
如果我去掉图标,图像会显示我想要的样子,但我也希望它上面有后退按钮图标。这是没有图标的样子:
我正在 iOS 上创建本机 UI 组件,我希望它的大小根据内容大小扩展。似乎我必须设置固定的宽度和高度才能呈现视图。知道如何解决吗?
// JS
import React from 'react';
import { View, requireNativeComponent } from 'react-native';
class StyledText extends React.Component {
render() {
return (
<View style={this.props.style}>
// without the height and width the compnent won't show up
<StyledLabelReactBridge styledText={'some text'} style={{height: 100, width: 100, backgroundColor: 'red'}}/>
</View>
);
}
}
StyledText.propTypes = {
styledText: React.PropTypes.string,
style: View.propTypes.style
};
const StyledLabelReactBridge = requireNativeComponent('StyledLabelReactBridge', StyledText);
module.exports = StyledText;
Run Code Online (Sandbox Code Playgroud)
// 目标-C
@implementation StyledLabelReactBridgeManager
RCT_EXPORT_MODULE()
- (UIView *)view
{
return [[NewStyledLabel …Run Code Online (Sandbox Code Playgroud) 监视文件更改时出错:
EMFILE {"code":"EMFILE","errno":"EMFILE","syscall":"查看文件更改时出错:","filename": null}?
"dependencies": {
"react": "16.0.0-alpha.12",
"react-native": "0.47.1",
"react-native-router-flux": "^4.0.0-beta.16",
"react-redux": "^5.0.5",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0"
}
Run Code Online (Sandbox Code Playgroud) 我目前正在使用 React Native 0.48 和 react-native-image-crop-picker 0.16。
我正在尝试获取文件 uri,并使用 FormData 和 Fetch 将其发送到服务器。
这是我正在做的代码片段:
var image = await ImagePicker.openPicker({
width: 500,
height: 500,
cropping: true,
includeBase64: true,
});
var media = {
uri: image.path,
type: 'image/jpeg',
name: 'file.jpg',
};
var formData = new FormData();
formData.append("file", media);
fetch("https://requestb.in/1e6lgdo1", {
method: 'post',
headers: {
'Content-Type': 'multipart/form-data',
},
body: formData
}).then(function(r){
console.log("Success", r);
}).catch(function(e){
console.log("Error", e);
}).done();
Run Code Online (Sandbox Code Playgroud)
不幸的是,当请求被发送到服务器而不是发送“文件”表单数据字段中的文件内容时,它只是发送“[对象对象]”。
根据您将请求发送到的位置,这会导致文件内容变为“[object Object]”或请求出错。
我无法确定这是我自己的代码的问题,还是本机本身的反应。任何帮助将不胜感激。
我正在为我的测试服务器使用https://github.com/jpillora/uploader。(注意:Go 在字符串化对象时从不使用符号 [object Object],所以我不认为问题出在服务器上。此外,我在将文件上传到 S3 时也看到了这一点。)
一个最终被发送的请求的例子是:
------WebKitFormBoundaryzt2jTR8Oh7dXB56z
Content-Disposition: …Run Code Online (Sandbox Code Playgroud) 如果我的移动应用程序有多个 RCTRootView 用法。我应该重用相同的 RCTBridge 还是为每个创建一个。假设两个 RCTRootView 可以在同一个 VC 或不同的 VC 上。谢谢你。
我正在使用React Native应用程序,并且许多屏幕都有带有文本输入字段的表单。
当我按文本输入时,键盘将打开。我创建了一个浮动InputAccessory组件,该组件出现在键盘顶部以将其关闭,并带有“完成”按钮。
但是,现在有了此配件,当我单击输入字段或按键盘上的“下一步”按钮转到下一个字段时,ScrollView滚动条将文本输入的底部与键盘的顶部对齐。有了这个浮动附件,就会出现问题,如下所示,由于有了该附件,您看不到文本输入的内容,我想让scrollview多滚动一点以显示整个文本输入。
我可能可以为此进行计算并.scrollTo()从ScrollView组件运行方法,但是这种模式在我的整个应用程序中非常常见,我正在寻找一种优雅的解决方案,该解决方案每次导入文本输入并专注于每次时都足够通用它。
你有什么建议吗?
谢谢
我的设备和 PC 连接到同一网络,我们如何解决此错误,
重新启动后,它给出了相同的错误:
Switched to a LAN URL because the tunnel appears to be down. Only devices in the same network can access the app. You can restart the project to try reconnecting.
Run Code Online (Sandbox Code Playgroud)
在我的设备上它说
Tunnel packager ....exp.not found
Run Code Online (Sandbox Code Playgroud)
顺便说一句,我在 Windows 上运行;谢谢
我也在Xcode首选项中选择了位置,但是得到了同样的错误
xcrun: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk' (errno=No such file or directory)
xcrun: error: unable to find utility "instruments", not a developer tool or in PATH
Command failed: xcrun instruments -s
xcrun: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk' (errno=No such file or directory)
xcrun: error: unable to find utility "instruments", not a developer tool or in PATH
Error: Command failed: xcrun instruments -s
xcrun: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk' (errno=No such file or directory) …Run Code Online (Sandbox Code Playgroud) react-native-ios ×10
react-native ×8
reactjs ×5
ios ×2
android ×1
expo ×1
facebook ×1
form-data ×1
javascript ×1
mobile ×1
react-redux ×1