小编Thi*_*vya的帖子

如何在反应原生中将<Text>文本设置为大写

如何<Text> some text </Text>在反应原生中设置为大写

<Text style={{}}> Test </Text>
Run Code Online (Sandbox Code Playgroud)

需要证明Test as TEST.

react-native

61
推荐指数
4
解决办法
6万
查看次数

如何在React Native中更改textInput占位符的字体系列

我必须更改textInput占位符文本的字体系列.如果我们添加它secureTextEntry={true},则为占位符文本设置所提到的字体系列.

<TextInput style={styles.textboxfield}  secureTextEntry={true} placeholder="Password" />
Run Code Online (Sandbox Code Playgroud)

但是如果我们删除它secureTextEntry={true},我们就不能为占位符设置font-family

<TextInput style={styles.textboxfield} placeholder="Password" />
Run Code Online (Sandbox Code Playgroud)

样式是:textboxfieldd:{height:39,backgroundColor:'#fffffff',marginBottom:0,fontFamily:'Inconsolata-Regular',},

如何更改占位符文本的字体系列?

placeholder react-native

13
推荐指数
2
解决办法
1万
查看次数

适用于 Android 的 React Native 推送通知

过去 2 周,我们一直坚持使用 react-native 中的 android 推送通知,并且我们尝试使用以下 react native 模块

https://www.npmjs.com/package/react-native-push-notification

使用上述模块,我们能够获得本地通知(来自应用程序的静态通知),该通知有效但未显示来自服务器的通知。我们已经尝试过“ https://github.com/oney/react-native-gcm-android ”这也..

能够注册 GCM 并从 GCM 获取令牌,但使用该注册令牌,无法获得通知和

我们正在使用 php 从服务器发送通知,php 代码如下

这是我们用来从服务器发送通知的代码,

<?php
function sendPushNotificationToGCM($registatoin_ids, $message) {
    $url = 'https://android.googleapis.com/gcm/send';
    $fields = array('registration_ids' => $registatoin_ids, 'data' => array("title" => 'hi', "message" => $message, ),  );
 define("GOOGLE_API_KEY", "YOUR API KEY");       
  $headers = array(
    'Authorization: key=' . GOOGLE_API_KEY,
    'Content-Type: application/json'
  );
 $ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, $url);
 curl_setopt($ch, CURLOPT_POST, true);
 curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
 $result …
Run Code Online (Sandbox Code Playgroud)

android push-notification react-native

4
推荐指数
1
解决办法
6311
查看次数