小编Mol*_*per的帖子

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
查看次数

NativeBase + Exponent标头

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

在此输入图像描述

有人有解决方法吗?

react-native native-base exponentjs

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

React Native KeyboardAvoidingView涵盖了最后的文本输入

我正在使用React Native的Keyboard Avoiding View,行为设置为padding(在Android上测试).

我的屏幕上有多个TextInputs.当我单击最终的TextInput时,键盘会覆盖它.我现在能够向下滚动,因为从KeyboardAvoidingView添加了填充,但它是理想的自动滚动焦点.

<Content>
  <KeyboardAvoidingView behavior='padding'>
    <TextInput placeholder='Example 1' />
    <TextInput placeholder='Example 2' />
    <TextInput placeholder='Example 3' />
    <TextInput placeholder='Example 4' />
    <TextInput placeholder='Example 5' />
    <TextInput placeholder='Example 6' />
    <TextInput placeholder='Example 7' />
  </KeyboardAvoidingView>
</Content>
Run Code Online (Sandbox Code Playgroud)

javascript react-native

14
推荐指数
4
解决办法
3万
查看次数

D3 - 向矩形添加背景填充

是否可以向矩形元素添加背景填充?我正在使用 rect 元素来创建条形图。每个 rect 元素都有一个宽度和填充集。我想用颜色填充剩余的宽度。

See here: http://codepen.io/jesouhaite08/pen/fhvzA
Run Code Online (Sandbox Code Playgroud)

谢谢!

d3.js

7
推荐指数
1
解决办法
7798
查看次数

React Native backgroundColor覆盖图像

我使用图像作为我的一个页面的背景.我想在图像上添加一个不透明度的backgroundColor.我不确定如何使用React Native实现这一目标.

render() {
  return (
    <Image source={require('./assets/climbing_mountain.jpeg')} style={styles.container}>
      <Text>Hello</Text>
    </Image>
  )
}

const styles = StyleSheet.create({
  container: {
  flex: 1,
  width: null,
  height: null,
}
Run Code Online (Sandbox Code Playgroud)

以下是我在网页上实现这一目标的方法:如何在CSS中对图像进行叠加?

javascript react-native

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

将输入集中在React Native中的Modal负载上

我正在使用React Native的Modal组件。当模态可见时,我想专注于TextInput和显示键盘。

任何想法如何做到这一点?

react-native

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