ImageBackground

React 实战教程 深入学习一线大厂必备前端技能,VIP 教程限时免费领取。 立即查看 >

A common feature request from developers familiar with the web is background-image. To handle this use case, you can use the <ImageBackground> component, which has the same props as <Image>, and add whatever children to it you would like to layer on top of it.

You might not want to use <ImageBackground> in some cases, since the implementation is very simple. Refer to <ImageBackground>'s source code for more insight, and create your own custom component when needed.

Note that you must specify some width and height style attributes.

示例#


文档#

Props#

Image Props#

imageStyle#

类型必填
image styles

imageRef#

Allows to set a reference to the inner Image component

类型必填
Ref

style#

Type
View Style

本文档贡献者:sunnylqm(84.21%), sunnylqm(15.79%)#