标签: native-base

动画:`useNativeDriver` 不是 ReactNativeBase 输入的指定问题

我今天(2020 年 4 月 3 日)创建了一个新的 react-native 项目并添加了一个 native-base。然后我尝试使用浮动标签添加输入。它给出了一条警告消息:动画:useNativeDriver未指定。这是一个必需选项,必须显式设置为truefalse。如果我删除了浮动标签属性或将其更改为 stackLabel 警告消失了。出现此警告时,onChangeText未调用。

警告信息

组件文件

import React from 'react';
import {
  SafeAreaView,
  ScrollView,
  StatusBar,
  StyleSheet,
  View,
} from 'react-native';

import {Input, Item, Label} from 'native-base';

import {Colors} from 'react-native/Libraries/NewAppScreen';

declare var global: {HermesInternal: null | {}};

const App = () => {
  return (
    <>
      <StatusBar barStyle="dark-content" />
      <SafeAreaView>
        <ScrollView
          contentInsetAdjustmentBehavior="automatic"
          style={styles.scrollView}>
          <View style={styles.body}>
            <Item floatingLabel>
              <Label>Test</Label>
              <Input onChangeText={text => console.log(text)} />
            </Item>
          </View>
        </ScrollView> …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs react-native native-base

44
推荐指数
3
解决办法
6万
查看次数

模块AppRegistry未注册可调用模块(调用runApplication)

我正在使用原生基础在反应原生中制作应用程序.我对这两件事都不熟悉.当我运行应用程序它给了我这个错误:

在此输入图像描述

这是我的代码:

export default class Point extends Component {

    render() {
        return (
            <Container>
                <Header>
                    <Left>
                        <Button transparent>
                            <Icon name='menu' />
                        </Button>
                    </Left>
                    <Body>
                        <Title>Header</Title>
                    </Body>
                    <Right />
                </Header>
            </Container>
        );
    }
}
Run Code Online (Sandbox Code Playgroud)

这是我的版本的截图

在此输入图像描述

和nativebase版本是 "native-base": "^2.1.2"

react-native native-base

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

加载字体本机错误

我收到错误:You started loading 'Roboto_medium', but used it before it finished loading使用原生基础时.

在此输入图像描述

我按照官方页面中的说明进行操作.

创建反应原生应用我正在使用create-react-native-app.

App.js

export default class App extends React.Component {

async componentWillMount() {
  await Expo.Font.loadAsync({
  'Roboto': require('native-base/Fonts/Roboto.ttf'),
  'Roboto_medium': require('native-base/Fonts/Roboto_medium.ttf'),
  'Ionicons': require('@expo/vector-icons/fonts/Ionicons.ttf'),
 });
}

 render() {
   return (
    <Container>
      <StatusBar hidden={true} />

    <Button>
      <Text>
        Button
      </Text>
    </Button>

    <ListaItens />
    </Container>
  );
}
} 
Run Code Online (Sandbox Code Playgroud)

reactjs react-native native-base

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

React Native必须双击onPress才能工作

我正在使用React Native和Native Base库.当键盘打开时,我需要一个onPress事件来触发Native Base的ListItem(相当于TouchableOpacity).

我现在必须单击一次关闭键盘,然后我可以按ListItem.

下面的内容标记等同于ScrollableView:

<Content keyboardShouldPersistTaps='always' keyboardDismissMode='on-drag'>
  <List>
    <ListItem style={styles.inspectionsItemDivider} itemDivider>
      <TextInput
        autoFocus={true}
        ref={(input) => { this.titleSearch = input }}
        placeholder='Start typing...'
        multiline={true}
        onChangeText={this.setSearchText.bind(this)}
        value={this.getSearchValue()}/>
    </ListItem>
    <View style={styles.searchContainer}>
      <Text style={styles.recentText}>Recommended Descriptions</Text>
      <List dataArray={this.state.searchedDescriptions} 
        renderRow={(description) =>
        <ListItem button onPress={() => this.setInformationDescription(description)}>
          <Text>{description}</Text>
        </ListItem>
      </List>
    </View>
  </List>
</Content>
Run Code Online (Sandbox Code Playgroud)

react-native native-base

21
推荐指数
2
解决办法
8374
查看次数

文本垂直对齐in react native(使用nativebase)

嗨,我想知道有一种方法可以在React Native中垂直对齐.我试图在底部定位,但我认为我无法找到一个好方法.

如果有人知道如何解决这个问题,请告诉我.

谢谢,

text vertical-alignment react-native native-base

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

在NativeBase和Shoutem之间,哪个最适合用于React Native?

我发现React Native有两个UI组件,它们主要使用.我想用其中一个.哪一个更容易使用和可定制?

reactjs react-native native-base shoutem

18
推荐指数
4
解决办法
2万
查看次数

在 React 18 中,SSRProvider 不是必需的,并且是一个 noop。您可以将其从您的应用程序中删除,如何解决此警告?

大家好,我在 React Native 中遇到此错误在 React 18 中,SSRProvider 不是必需的,并且是一个 noop。您可以从您的应用程序中删除它我已经尝试过这个@react-aria/ssr并使用而不是,但没有解决警告。任何的意见都将会有帮助。

我使用反应18.2.0,本机基础^ 3.4.28,反应本机0.71.8。

下面是我在 App.js 中的代码

<Provider store={store}>
    <NativeBaseProvider theme={theme}>
      <SafeAreaView style={{flex: 1, backgroundColor: '#292929'}}>
        <StatusBar
          translucent
          backgroundColor="#292929"
          barStyle="light-content"
        />
        <AppNavigation />
      </SafeAreaView>
    </NativeBaseProvider>
  </Provider>
Run Code Online (Sandbox Code Playgroud)

我已经尝试过这个 @react-aria/ssr 并使用代替,但没有解决警告。任何的意见都将会有帮助。

reactjs react-native native-base

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

反应原生的权利到左派

通过使用这个代码(在下面),应用程序已经RTL但右和左的位置发生了变化(所以必须在右边显示的东西都转向左).我是通过教程完成的.

ReactNative.I18nManager.allowRTL(true);
Run Code Online (Sandbox Code Playgroud)

另一个问题是当Mobile的语言是LTR时,图像和设计的位置变成了另一面(例如从右到左的变化),因为App只有一种LTR语言.有没有办法让人们像对方一样展示RTL和LTR?

react-native native-base

15
推荐指数
1
解决办法
3443
查看次数

React-Native Detect Screen Notch

我使用nativebase.io作为我的应用程序的UI框架.

我的问题

当我输入IOS设备的标题时,如果iPhone模拟器正在模拟iPhone X(屏幕顶部有一个凹口),Header元素会自动检测到这一点,并将Header元素移到屏幕下方.

一些Android设备在屏幕顶部也有类似的缺口,但是当我使用nativebase.io Header元素时,它不会检测到缺口并且Header与缺口重叠.

我的问题

是否有一种方法在react-native或nativebase.io上检测显示是否有缺口?这样我就能动态地偏移Header.

react-native native-base

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

NativeBase + Exponent标头

我正在使用带有Exponent的NativeBase.标题位于手机的StatusBar下方.您可以在Exponent发布的NativeBase演示中看到这一点.

在此输入图像描述

有人有解决方法吗?

react-native native-base exponentjs

14
推荐指数
2
解决办法
5754
查看次数