yuanguozheng / jdapp Goto Github PK
View Code? Open in Web Editor NEW基于React Native构建的仿京东客户端
License: Apache License 2.0
基于React Native构建的仿京东客户端
License: Apache License 2.0
The following build commands failed:
CompileC /Users/weiyang/Documents/self-project/react-native/JdApp/ios/build/Build/Intermediates/RCTText.build/Debug-iphonesimulator/RCTText.build/Objects-normal/x86_64/RCTTextManager.o RCTTextManager.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/weiyang/Documents/self-project/react-native/JdApp/ios/build/Build/Intermediates/RCTNetwork.build/Debug-iphonesimulator/RCTNetwork.build/Objects-normal/x86_64/RCTNetworkTask.o RCTNetworkTask.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
Installing build/Build/Products/Debug-iphonesimulator/JdApp.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/JdApp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
weiyangdeMacBook-Pro:JdApp weiyang$ react-native -v
react-native-cli: 2.0.1
react-native: 0.48.4
你好,谢谢你的教程,让我学到了许多东西。
我是看你的博客 http://blog.csdn.net/yuanguozhengjust/article/details/50601111 学习的。
在这篇博文里,控件是
render() {
return (
<TouchableWithoutFeedback>
<View style={{alignItems:'center',flex:1}}>
<Image style={styles.iconImg} />
<Text>Example Text</Text>
</View>
</TouchableWithoutFeedback>
);
}
请问为什么要在View外面套个 TouchableWithoutFeedback ? 我看这个 TouchableWithoutFeedback好像也没用到?
Undefined symbols for architecture x86_64:
"std::terminate()", referenced from:
___clang_call_terminate in libReact.a(RCTJSCExecutor.o)
"___cxa_begin_catch", referenced from:
___clang_call_terminate in libReact.a(RCTJSCExecutor.o)
"___gxx_personality_v0", referenced from:
-[RCTJavaScriptContext initWithJSContext:onThread:] in libReact.a(RCTJSCExecutor.o)
-[RCTJavaScriptContext init] in libReact.a(RCTJSCExecutor.o)
-[RCTJavaScriptContext invalidate] in libReact.a(RCTJSCExecutor.o)
_RCTNSErrorFromJSError in libReact.a(RCTJSCExecutor.o)
+[RCTJSCExecutor runRunLoopThread] in libReact.a(RCTJSCExecutor.o)
-[RCTJSCExecutor init] in libReact.a(RCTJSCExecutor.o)
-[RCTJSCExecutor context] in libReact.a(RCTJSCExecutor.o)
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
新版本没人遇到这个问题吗?
ERROR Error watching file for changes: EMFILE
{"code":"EMFILE","errno":"EMFILE","syscall":"Error watching file for changes:","filename":null}
Error: Error watching file for changes: EMFILE
at _errnoException (util.js:992:11)
at FSEvent.FSWatcher._handle.onchange (fs.js:1359:9)
图片的点击事件写在_renderPage方法中,会自动的点击,该怎么处理?
底部图标无法上下居中,按照楼主?(不知道叫什么好,233)图标能居中是通过 marginTop: 12.5 将图标挤下来,但是在我这里不起作用
是tab-navigator的版本不一样造成的吗?刚学习RN 太懂,有什么方法可以让图标居中的
下面代码
import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
Image
} from 'react-native';
import Header from './Header';
import TabNavigator from 'react-native-tab-navigator';
const HOME = 'home';
const HOME_NORMAL = require('./image/tabs/home_normal.png');
const HOME_FOCUS = require('./image/tabs/home_focus.png');
const CATEGORY = 'category';
const CATEGORY_NORMAL = require('./image/tabs/category_normal.png');
const CATEGORY_FOCUS = require('./image/tabs/category_focus.png');
const FAXIAN = 'faxian';
const FAXIAN_NORMAL = require('./image/tabs/faxian_normal.png');
const FAXIAN_FOCUS = require('./image/tabs/faxian_focus.png');
const CART = 'cart';
const CART_NORMAL = require('./image/tabs/cart_normal.png');
const CART_FOCUS = require('./image/tabs/cart_focus.png');
const PERSONAL = 'personal';
const PERSONAL_NORMAL = require('./image/tabs/personal_normal.png');
const PERSONAL_FOCUS = require('./image/tabs/personal_focus.png');
export default class MainScreen extends Component {
constructor(props) {
super(props);
this.state = {selectedTab: HOME}
}
_renderTabItem(img, selectedImg, tag, childView) {
return (
<TabNavigator.Item
selected={this.state.selectedTab === tag}
renderIcon={() => <Image style={styles.tabIcon} source={img}/>}
renderSelectedIcon={() => <Image style={styles.tabIcon} source={selectedImg}/>}
onPress={() => this.setState({ selectedTab: tag })}>
{childView}
</TabNavigator.Item>
);
}
static _createChildView(tag) {
return (
<View style={{flex:1,backgroundColor:'#00baff',alignItems:'center',justifyContent:'center'}}>
<Text style={{fontSize:22}}>{tag}</Text>
</View>
)
}
render() {
return (
<View style={{flex: 1}}>
<Header />
<TabNavigator hidesTabTouch={true} tabBarStyle={styles.tab}>
{this._renderTabItem(HOME_NORMAL, HOME_FOCUS, HOME, MainScreen._createChildView(HOME))}
{this._renderTabItem(CATEGORY_NORMAL, CATEGORY_FOCUS, CATEGORY, MainScreen._createChildView(CATEGORY))}
{this._renderTabItem(FAXIAN_NORMAL, FAXIAN_FOCUS, FAXIAN, MainScreen._createChildView(FAXIAN))}
{this._renderTabItem(CART_NORMAL, CART_FOCUS, CART, MainScreen._createChildView(CART))}
{this._renderTabItem(PERSONAL_NORMAL, PERSONAL_FOCUS, PERSONAL, MainScreen._createChildView(PERSONAL))}
</TabNavigator>
</View >
);
}
}
const styles = StyleSheet.create({
tab: {
height: 52,
backgroundColor: '#303030',
alignItems: 'center',
},
tabIcon: {
width: 30,
height: 35,
resizeMode: 'stretch',
marginTop: 12.5
}
});
这个开源库ios和android都通用么,现在有bug么?
Invariant Violation: Module name prefixes should've been stripped by the native side but wasn't for RCTStatusBarManager
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.