反应本机自动链接不适用于反应本机矢量图标。我使用此https://github.com/oblador/react-native-vector-icons/issues/1035将其修复为android
但是在IOS上,我仍然面临问题。请让我知道是否有人解决了此问题...谢谢!
这是我面临的问题的屏幕截图。
reactjs react-native react-native-ios react-native-vector-icons
我想检查条件
if (value in List) {
exist
} else {
not exist
}
Run Code Online (Sandbox Code Playgroud)
但没有什么可以帮助任何有想法的人请分享.
My List = _quantityController[];
Run Code Online (Sandbox Code Playgroud)
itemId是整数
我想检查我的列表数组中是否存在我的项目ID ...谢谢!
我是 RN 的新手,如果有人可以对此分享想法或任何帮助,我需要实现如下图所示的内容。
我在不同大小的圆圈和那里的位置上遇到问题。
我尝试了下面的代码,它看起来很相似,唯一的问题是圆圈和间距看起来不太好,这是我的代码:
<FlatList
data={this.state.moviesList}
numColumns={3}
keyExtractor={this._keyExtractor}
renderItem={this.renderRowItem}
/>
Run Code Online (Sandbox Code Playgroud)
这是渲染行:
renderRowItem = (itemData) => {
var RandomNumber = Math.floor(Math.random() * 50) + 70;
return (
<View style={styles.listSec}>
<TouchableOpacity
onPress={()=> {this.props.navigation.navigate('Tutorials')}}>
<View style={{
backgroundColor: '#f673d7',
borderRadius: 100/2,
justifyContent: 'center',
alignSelf: 'center',
height: RandomNumber + itemData.item.title.length,
width: RandomNumber + itemData.item.title.length,
//paddingVertical: 10,
//paddingHorizontal: 10
}}>
<Text
style={{color: '#fff',
alignSelf:'center',
fontSize: 18,
fontWeight: '500',
fontSize: RandomNumber/5
}}>
{itemData.item.title}</Text>
</View>
</TouchableOpacity>
</View>
)
}
Run Code Online (Sandbox Code Playgroud) Android Release Build 从我这边成功完成,但我不知道如何为 IOS 生成构建
Androidgradlew assembleRelease是sucessfully从我这边完成的
IOS 发布构建并提交到应用商店。
我对 React Native IOS 构建有一个大问题。当我开始归档项目时,我的项目(RN 0.57.1)需要很长时间。
我正在使用以下步骤:
1) 清理构建文件夹。
2)编辑模式并发布所有内容。
3) 选择通用 IOS 设备和产品 > 存档。
创建构建需要 15-20 分钟,然后编译构建需要 15-20 分钟。我不知道这是 IOS 版本的本机问题,还是我在这里做错了。
如果有人有减少构建 IOS 构建时间的解决方案,请告诉我。
Android 构建工作正常。
我正在尝试获取本机中设备的当前位置。我正在使用下面的库来获取位置:
react-native-geolocation-service
Run Code Online (Sandbox Code Playgroud)
我的代码:
try {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
{
title: 'Device current location permission',
message:
'Allow app to get your current location',
buttonNeutral: 'Ask Me Later',
buttonNegative: 'Cancel',
buttonPositive: 'OK',
},
);
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
this.getCurrentLocation();
} else {
console.log('Location permission denied');
}
} catch (err) {
console.warn(err);
}
}
getCurrentLocation(){
Geolocation.requestAuthorization();
Geolocation.getCurrentPosition(
(position) => {
alert(position.coords.latitude);
this.socket.emit('position', {
data: position,
id: this.id,
});
},
(error) => {
alert("map error: "+error.message);
console.log(error.code, error.message);
},
{ …Run Code Online (Sandbox Code Playgroud) 我的API要求是
网址:/ user / upload-profile-image
方法=开机自检
标头-
Accesstoken:“ access_token”
内容类型=多部分/表单数据
这是我的代码:
Future getUploadImg(File _image) async {
String apiUrl = '$_apiUrl/user/upload-profile-image';
final length = await _image.length();
final request = new http.MultipartRequest('POST', Uri.parse(apiUrl))
..files.add(new http.MultipartFile('avatar', _image.openRead(), length));
http.Response response = await http.Response.fromStream(await request.send());
print("Result: ${response.body}");
return JSON.decode(response.body);
}
Run Code Online (Sandbox Code Playgroud) 我们如何使用自定义数据向我的 android 模拟器发送测试推送通知?我有 FCM 令牌,它应该只直接出现在我的模拟器上......我不想向所有应用程序用户发送通知。
有没有什么办法可以从 firebase 云消息中做到这一点,所以我可以用我的数据进行测试。
我想将参数从我的Dialouge框(Void函数)传递给另一个void函数,但是会出错
无法分配给参数类型()void flutter
和setState也无法正常工作.
请在这里查看我的代码:
第一个功能
void _quantity(BuildContext context, productId,quantity){
setState(() {
productId = productId;
quantity = quantity;
_quantityController.text = '$quantity';
});
var alert = new AlertDialog(
actions: <Widget>[
FlatButton(
child: Text("Save"),
onPressed: _addtoCart(context, productId)
)
],
);
showDialog(context: context,builder: (context) => alert);
}
Run Code Online (Sandbox Code Playgroud)
第二功能:
void _addtoCart(BuildContext context, productId) {
print("Quantity: $quantity");
print("productId: $productId");
print("data: $data");
}
Run Code Online (Sandbox Code Playgroud)
请点击此处查看截图
我正在使用initState并出现导航器问题:
I / flutter(5726):构建Builder时引发了以下断言:I / flutter(5726):在构建过程中调用了setState()或markNeedsBuild()。
我的代码:
@override
void initState() {
super.initState();
print(globals.isLoggedIn);
if(globals.isLoggedIn) {
print("Already login");
Navigator.push(context, MaterialPageRoute(builder: (context)=> Dashboard()));
}
Run Code Online (Sandbox Code Playgroud) react-native ×6
flutter ×4
dart ×2
action ×1
geolocation ×1
http-headers ×1
image ×1
parameters ×1
reactjs ×1
upload ×1
void ×1