小编Ibr*_*med的帖子

如何在Android的React Native中设置阴影?

嗨我正试图为我的工厂设置一个阴影,但我的尝试失败到目前为止我尝试设置阴影道具,但这只是为了ios所以我试图玩升力属性,但它看起来不正确.

这是我试过的

<View style={{width: 56, height: 56, elevation: 2, borderRadius: 28, marginBottom: 3, backgroundColor: 'rgba(231,76,60,1)'}}></View>
Run Code Online (Sandbox Code Playgroud)

我需要实现的目标

在此输入图像描述

react-native

58
推荐指数
9
解决办法
9万
查看次数

React Native-TouchableOpacity在绝对定位的视图中不起作用

我有一个绝对定位的视图,其中包含3个TouchableOpacity组件,而这3个组件均无法响应,这根本不起作用,这是怎么回事,请帮帮我:)

<View style={[styles.highNormalLowDocListHeaderStateContainer, {width: this.windowWidth, height: this.headerSmallHeight, position: 'absolute', left: 0, top: floatedHeaderTitleTop, elevation: 2}]}>
    <TouchableOpacity onPress={() => this.getDocuments('high')} style={[styles.highNormalLowDocListHeaderStateTextContainer, highSelected.borderStyle]}>
        <Text style={[styles.highNormalLowDocListHeaderStateText, highSelected.textStyle]}>HIGH</Text>
    </TouchableOpacity>
    <TouchableOpacity onPress={() => this.getDocuments('normal')} style={[styles.highNormalLowDocListHeaderStateTextContainer, normalSelected.borderStyle]}>
        <Text style={[styles.highNormalLowDocListHeaderStateText, normalSelected.textStyle]}>NORMAL</Text>
    </TouchableOpacity>
    <TouchableOpacity onPress={() => this.getDocuments('low')} style={[styles.highNormalLowDocListHeaderStateTextContainer, lowSelected.borderStyle]}>
        <Text style {[styles.highNormalLowDocListHeaderStateText, lowSelected.textStyle]}>LOW</Text>
    </TouchableOpacity>
</View>
Run Code Online (Sandbox Code Playgroud)

屏幕截图

在此处输入图片说明

android react-native

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

React原生Android文本组件额外填充

我想知道为什么padding在反应原生的文本中得到这些奇怪的东西.我想尽一切事情只得到一个完美的文本,但似乎没有任何工作只有工作是事paddingVerticalpaddingHorizontal,但它太哈克和不可靠的.

<Text numberOfLines={1} 
      style={{
            backgroundColor: 'red', 
            lineHeight: 92, 
            textAlign: 'center', 
            textAlignVertical: 'center', 
            padding: 0, 
            margin: 0, 
            fontSize: 92,  
            color: '#2d76ff', 
            fontFamily: 'Roboto-Regular', 
            includeFontPadding: false}}>
      {this.state.documents}
</Text>
Run Code Online (Sandbox Code Playgroud)

Zeplin

在此输入图像描述

我的HTC截图

在此输入图像描述

react-native zeplin

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

堆栈空例外

我得到一个堆栈空异常.如果堆栈不为空(它有16个项目),那怎么可能?

我得到了错误的快照:

堆栈空例外

有人可以解释一下吗?

c# stack multithreading fifo visual-studio-2012

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

如何在React Native中实现像CoordinatorLayout这样的东西?

我想实现像android的CoordinatorLayout这样的行为总是为我的ToolBar输入我试过太多的解决方案一些确实有效但不完全像https://github.com/maolion/mao-rn-android-kit这真的很酷但是有一个因为它不能与ListView一起使用我也尝试过Animated但是android上的滚动事件限制只是在大多数情况下都不起作用它甚至都不起作用.

使用mao-rn-android-kit

<CoordinatorLayoutAndroid ref={(component) => this.coordinatorLayout = component} fitsSystemWindows={false}>
    <AppBarLayoutAndroid
        layoutParams={{
                            width: 'match_parent',
                            height: 112
                        }}
        style={{ backgroundColor:"#528eff" }}>
        <View layoutParams={{height: 56, width: this.windowWidth, scrollFlags: (
                                    AppBarLayoutAndroid.SCROLL_FLAG_SCROLL |
                                    AppBarLayoutAndroid.SCROLL_FLAG_ENTRY_ALWAYS)}} style={{height: 56}}>
            <ToolbarAndroid
                titleColor={'#FFF'}
                title={this.props.title}
                navIcon={images.arrowBack}
                onIconClicked={() => this._goBack()}
                onActionSelected={() => {}}
                actions={[{title: 'Search', icon: images.search, show: 'always'}]}
                style={[{backgroundColor: '#528eff', width: this.windowWidth, height: 56}]}/>
        </View>
        <View layoutParams={{height: 56, width: this.windowWidth}}
              style={{flex: 0, flexDirection: 'row', justifyContent: 'center', width: this.windowWidth, backgroundColor: '#528eff'}}>
            <TouchableOpacity onPress={() => this.getDocuments('high')}
                              style={[styles.highNormalLowDocListHeaderStateTextContainer, highSelected.borderStyle]}>
                <Text
                    style={[styles.highNormalLowDocListHeaderStateText, highSelected.textStyle]}>HIGH</Text> …
Run Code Online (Sandbox Code Playgroud)

android native react-native

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

如何生成一个永不过期的令牌?

我需要创建一个可以持续很长一段时间的松弛令牌,但我能找到的只是测试令牌,我不知道他们甚至会因为我试图在他们的文档中搜索但是我能找到的所有内容都是机器人令牌和测试令牌,你的帮助非常感谢,我使用facebook的API,他们有一种方法来生成一个永不过期的令牌是松弛可用吗?

slack-api slack

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

当输入 Hashtag 后跟一个或多个字符时突出显示 textarea 中的文本

我希望能够让用户在文本区域中打字,如果他输入一个哈希标签,然后在他输入文本时输入一个或多个字符,直到他点击空格。

问题是我想实现像 Facebook 的新哈希标签功能一样的东西,我已经完成了编码的逻辑,但仍然无法在视觉上实现它。

我尝试的方法是使用 Jquery,如下所示:

<textarea id="txtArea">Here is my #Hash</textarea>

$("#txtArea").onkeyup(function(){

var result = $("#txtArea").match(/ #[\w]+/g);

//result = '#Hash'
});
Run Code Online (Sandbox Code Playgroud)

但我无法完成,我不知道从哪里开始,所以我可以使用任何解决方案、建议、插件,我将不胜感激。

html javascript css jquery

0
推荐指数
1
解决办法
4413
查看次数