React Native图片阴影未显示在视图上

时间:2019-04-09 05:21:36

标签: android image react-native

我有一个带阴影的png图像。

enter image description here

但是当我试图将其添加到react native中时,阴影不会出现。

enter image description here

我尝试给该视图添加阴影。我能够在IOS中添加顶部阴影,但Android不支持顶部阴影。

有什么方法可以在android中实现顶部阴影,也可以通过阴影显示完整的png文件。

我正在使用React Native 0.55.4和Android 8.0.0

谢谢。

2 个答案:

答案 0 :(得分:1)

对于android,请使用属性router.events.filterreact-native-shadow react-native-shadow工作示例

 var results = [];
        var lastColumn = this.chart.length -1 ;
        for(var j in this.chart[lastColumn])
        {
         if(!this.chart[lastColumn][j].expectedNonTerminal(grammar))
         {
        results.push(this.chart[lastColumn][j].rhs.toString());
         }
        }

        return results;

答案 1 :(得分:1)

我喜欢使用react-native-shadow在Android上创建阴影视图。

该组件将类似于:

print (df)
   A_Organisation  A_count  A_Normalised  Year B_Organisation  B_count  \
0             ABC    654.0       34545.0  2018            MNO    123.0   
1             DEF    565.0       54564.0  2018            MNO    133.0   
2             GHI    565.0       34546.0  2018            NaN      NaN   
3             QWE    790.0        3945.0  2018            NaN      NaN   
4             DSO    788.0        1561.0  2017            MNO   8743.0   
5             DFB  34579.0         546.0  2017            NaN      NaN   
6             HHS     56.0       31651.0  2017            NaN      NaN   
7            FDGH     98.0         156.0  2016            NaN      NaN   
8            DSFH  51651.0      153156.0  2016            NaN      NaN   
9            KBIU    151.0        1561.0  2015            MNO   1335.0   
10            SDF    165.0        6513.0  2015            NaN      NaN   
11            NaN      NaN           NaN  2014            MNO    456.0   
12            NaN      NaN           NaN  2014            MNO    345.0   

    B_Normalised  
0          432.0  
1          234.0  
2            NaN  
3            NaN  
4          484.0  
5            NaN  
6            NaN  
7            NaN  
8            NaN  
9         1512.0  
10           NaN  
11        3454.0  
12         234.0