React Native-如何制作边框图像? [英] React Native - how to make a border image?

查看:41
本文介绍了React Native-如何制作边框图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 View 上制作边框图像,类似于边框图片在CSS中.

I want to make a border image to a View , similar to border-image in the css.

我该如何实现?

推荐答案

我相信,如果您使用样式化组件( https://www.styled-components.com/),您可以直接使用CSS进行设置.会是这样的:

I believe that if you use Styled Components (https://www.styled-components.com/) you can set it with CSS directly. It will be something like this:

import styled from 'styled-components/native';

const StyledView = styled.View`
  border-image: <your definition here>;
`;

然后像往常一样简单地使用它:

And then simply use it like you always do:

<StyledView>

</StyledView>

希望有帮助!

这篇关于React Native-如何制作边框图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆