简体   繁体   English

需要在 react-native 底部导航器中进行设计,如下图

[英]Need to make design in react-native bottom navigator as below image

I want a UI simillar to the image in which corners above a view should be rounded in as shown in as image.我想要一个类似于图像的 UI,其中视图上方的角应该被四舍五入,如图所示。

用这个角在图像中平方进行设计

Something like this should achieve your desired result, just replace the div:before block with the item at the top in your screenshot if it is an image.像这样的东西应该可以达到您想要的结果,只需将div:before块替换为屏幕截图顶部的项目(如果它是图像)。 If no image use div:before changing the color is box-shadow .如果没有图像使用div:before改变颜色是box-shadow

div {
  position:relative;
  width: 300px;
  height: 80px;
  background: #522d5b;
}

div:before {
  content: "";
  position:absolute;
  top:-40px;
  left:0;
  height:40px;
  width:300px;
  border-bottom-left-radius: 25px;
  border-bottom-right-radius: 25px;
  box-shadow: 0 20px 0 0 #fff;
}

You need to use the below style and the image will be the same as per your requirement您需要使用以下样式,图像将与您的要求相同

  • borderBottomLeftRadius: number边界底部左半径:数字
  • borderBottomRightRadius: number borderBottomRightRadius:数字

Below is the code sample you can refer to.以下是您可以参考的代码示例。

image: {
  borderBottomLeftRadius: 25,
  borderTopLeftRadius: 25,
}

one more solution is there还有另一种解决方案

borderRadius:0,0,20,0;

Also, you can find more info in the view component docs .此外,您可以在视图组件文档中找到更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM