相关疑难解决方法(0)

React Native - 使用动态名称的图像需求模块

我目前正在使用React Native构建测试应用程序.到目前为止,Image模块一直运行良好.

例如,如果我有一个名为的图像avatar,下面的代码片段工作正常.

<Image source={require('image!avatar')} />
Run Code Online (Sandbox Code Playgroud)

但是,如果我将其更改为动态字符串,我会得到

<Image source={require('image!' + 'avatar')} />
Run Code Online (Sandbox Code Playgroud)

我收到错误:

Requiring unknown module "image!avatar". If you are sure the module is there, try restarting the packager.

显然这是一个人为的例子,但动态图像名称很重要.React Native不支持动态图像名称吗?

使用动态图像名称响应本机错误

javascript jsx react-native

65
推荐指数
9
解决办法
6万
查看次数

为什么内联"背景图片"样式在Chrome 10和Internet Explorer 8中不起作用?

为什么以下示例在Firefox 4中显示图像,但在Chrome 10和Internet Explorer 8中不显示?

HTML:

<div style="background-image: url('http://www.mypicx.com/uploadimg/1312875436_05012011_2.png')"></div>
Run Code Online (Sandbox Code Playgroud)

CSS:

div {
    width: 60px;
    height: 60px;
    border: 1px solid black;
}
Run Code Online (Sandbox Code Playgroud)

任何解决方法的想法?

html css google-chrome background-image internet-explorer-8

50
推荐指数
4
解决办法
26万
查看次数