## Dependency

react native components:

• TabBarIOS
• Navigator
• WebView

third library:

• react-native-vector-icons

## Trouble Shooting

Sometimes the third-party libraries not fully integrated into the project even doing rnpm link. In such case, delete the node_modules folder and install again, rm -rf node_modules && npm install, then do rnpm link to help link with IOS libraries instead of doing it mannually.

### How to center an image of fixed size

Apply flex: 1, justifyContent: 'center', alignItems: 'center' styling on image’s parent element, then for that image’s styling, only specify its fixed height and width will work!

### TouchableHighlight

TouchableHighlight component can only has one child element, thus if we want to have multiple children elements, wrap them into a single view container.

Notice one error I met, we need to directly use a View component after TouchableHighlight.

Finally using Navigator instead of NavigatorIOS, there are several important things to remember:

• we have an renderScene method in index.ios.js that defines what component to render when there is an scene being pushed.

And utilizing the spread syntax of passing properties, we can easily allow next scene to use the data passed from the previous scene, the one being trigger(ususally by pressing).

• The problem of “this”. In the above example, we use the ES6 arrow syntax, which automatically bind “this” for us, which means that the “this” inside the function we called points to the current component. However, if we use common function assignment like onPress={this.onPress.bind(this)}, we have to manually bind this to it!!!

check this post for more information. And refer to the source code of example navigator example.

### TabBarIOS

Check this post for more helpful information.

### Image not rendering from ListView

• One weird thing happened is that using the same uri from Day2 project, I want to render luffy on each row of ListView, but it doesn’t show up. Then, I change to a small and https-sourced image from facebook’s github repo, then it works. Not sure how to deal with it yet.
• Some one from issue panel says that image may not be updated in ListView and you have to add an “ID” attribute to forcely update it, it can be saved for later’s use.

### Icon

Most used library for Icon is “react-native-vector-icons”, and simply import corresponding libraries will do the tricks, import Icon from 'react-native-vector-icons/Ionicons'; Then, use this website for searching new icons. If animation required, use react-native-animatable to animate. icons.

### Nativebase

It’s a surprise for me! Just like the bootstrap for html, nativebase gives so much template to build react native front-end. Check this tutorial for more examples.

### Webview render HTML

Use react-native-htmlview to render HTML-like text, which usually contains HTML tags like <p> and </br> and so on. In order to directly jump to the original web page, we simple use react-native-webview library.

## Data

Here is a handy website that transforms rss feed into json, and provides a API for that: http://rss2json.com/. For example, my blog’s rss feed being transformed to json is: http://rss2json.com/api.json?rss_url=http%3A%2F%2Fchocoluffy.com%2Fatom.xml. Then using this json file, we can have a much more consistent and clear structure to formatize into RN app.