我正在使用react-native 0.28.0
我试图根据本教程在iPhone模拟器上显示图像:http://www.appcoda.com/react-native-introduction/
var styles = StyleSheet.create({
image: {
width: 107,
height: 165,
padding: 10
}
}
var imageURI = 'http://books.google.com/books/content?id=PCDengEACAAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api'
Run Code Online (Sandbox Code Playgroud)
然后在render()函数中,我添加:
<Image style={styles.image} source={{uri:imageURI}} />
Run Code Online (Sandbox Code Playgroud)
为图像分配的空间在那里,但图像未显示.
我正在使用react-native 0.28.0
我试图根据本教程在iPhone模拟器上显示图像:http://www.appcoda.com/react-native-introduction/
var styles = StyleSheet.create({
image: {
width: 107,
height: 165,
padding: 10
}
}
var imageURI = 'http://books.google.com/books/content?id=PCDengEACAAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api'
Run Code Online (Sandbox Code Playgroud)
然后在render()函数中,我添加:
<Image style={styles.image} source={{uri:imageURI}} />
Run Code Online (Sandbox Code Playgroud)
为图像分配的空间在那里,但图像未显示.
但是,如果我使用本地图像,则会显示图像.
var Picture = require('./content.jpeg')
Run Code Online (Sandbox Code Playgroud)
在render()功能:
<Image source={Picture} style={styles.thumbnail} />
Run Code Online (Sandbox Code Playgroud)
如何使用URI作为源显示图片?
在MyModule中,我有这个枚举:
enum MyError: ErrorType {
case failToSendMessage
case notAuthenticated
case noResponseReceived
}
Run Code Online (Sandbox Code Playgroud)
在MyModuleTests中:
import XCTest
@testable import MyModule
class MyModuleTests: XCTestCase {
func testNotAuthenticated() {
myClass.doSomething()
.subscribeError { error in
XCTAssertEqual(error, MyError.notAuthenticated)
}
}
}
Run Code Online (Sandbox Code Playgroud)
doSomething返回一个Observable.
为什么我收到此错误消息:
Cannot invoke 'XCTAssertEqual' with an argument list ((ErrorType), MyError)?