SomeUser
SomeUser

Reputation: 2041

How do i make React Native app look the same on iOS and Android?

I want to achieve the same look on both platforms, like Instagram does, for example. By default react native is bringing platform-specific UIs

Upvotes: 2

Views: 3711

Answers (3)

xotahal
xotahal

Reputation: 170

I'm working on react-native-material-ui which should be close to material-ui.

We needed to have option to completely and very easily change style/theme of the application. And there is no library that provides that possibility. Of course, you can set couple of things via props of component. But you have to change it on every place in your code where you use that component.

In react-native-material-ui

  • you can define object that will be merged with default styles and use everywhere in your app - very easy
  • there is still possibility to change style of only one component via props
  • or you can use your style even in your own components (via context)

Upvotes: 1

Haitao Li
Haitao Li

Reputation: 1713

If you want the same look across the platforms then you need to rebuild all common components and apply your design styles. Or you can just use some existing library to do that. I like material design style, so I'll probably pick one of the following:

https://github.com/react-native-material-design/react-native-material-design https://github.com/xinthink/react-native-material-kit

Upvotes: 1

Rafael Steil
Rafael Steil

Reputation: 4697

Yes, because that's the way it works, just like if you were using plain Java and Objective-C/Swift. React Native isn't meant to be a one size fits all approach, neither does it intent to be a framework where you can create an app that looks the same in all platforms.

You'll have to customize the colors, views and images in each app, using the tools and UI frameworks and toolkits available in each one.

Updated for more information

It's harder to answer that than you may think :), because the choose of the framework has direct impact on how you develop the applications and which technologies you and your team will have to use. For example, you may go with a hybrid approach (like Cordova) so you can use HTML and CSS, but that may be a shot in the foot depending on what you want to achieve.

You could also go with Xamarin and its Xamarin.Forms UI framework (which I actually use and find it great), but then you'll have to stick with C# and still need to do platform tweaks.

You may want tro try a (paid) product called "Native CSS" (https://nativecss.com, I have no relation to it) that allows you to use CSS in native code.

The point is, without specific details of your needs, capabilities and even business decisions, it's very hard to securely say "go with this approach".

However, In my experience it's not THAT hard to make the app look the same in Android and iOS, because all you have to do is to use each platform's tools to draw the UI the way you want.

Upvotes: 4

Related Questions