React Navigation Stack Navigator default shadow styling

六月ゝ 毕业季﹏ 提交于 2019-12-12 10:53:32

问题


I'm using React Navigation to construct a tab bar based type of an app in ReactNative.

  • "react-native": "0.44.0",
  • "react-navigation": "^1.0.0-beta.9",

I've got the navigation part pinned down and working. But with regards to styling I'm seeing a shadow on the StackNavigator (navigation controller) inside tab bar. Refer image below.

I'm not used to seeing this kind of a shadow on native iOS apps (I'm an iOS mobile dev trying out RN)

upon further investigation I saw that there are 'shadow' properties specified in 'Card.js' in ReactNavigation. So I manage to fixed the issue by passing in some overriding cardStyle like so

cardStyle: { shadowColor: 'transparent' }

Given all the above, I have two questions

Question 1 Why is this the default behaviour/styling?

To debug the issue, I decided to do a quick view debugging in Xcode and found that 'shadow' does not show up in there.

Question 2 Why is this happening?. Since RN app is essentially a native app (native iOS in this instance), isn't view debugging a reliable way to debug these kind of view related issues?

来源:https://stackoverflow.com/questions/43772224/react-navigation-stack-navigator-default-shadow-styling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!