Flutter vs React Native.哪个框架在样式方面更接近原生?

huangapple go评论99阅读模式
英文:

Flutter vs React Native. Which framework is more native in terms of style out of the box?

问题

根据您提供的信息,React Native 在自适应本地样式方面似乎比 Flutter 更具优势,因为它更容易在两个平台之间自动适应样式,而无需手动区分。React Native相对于Flutter而言,在这方面更自适应。但需要注意的是,React Native可能具有较少的预构建组件,您可能需要自己构建更多组件。

相比之下,Flutter 具有更多预构建组件(小部件),但它在本地样式自适应方面不如 React Native,因为它更倾向于使用 Material Design 风格,开发者需要明确告诉 Flutter 在iOS和Android之间进行区分。

最终的选择可能会取决于您的项目需求和个人偏好。如果您更注重自适应本地样式,可以考虑使用 React Native。如果您更喜欢具有更多预构建组件的框架,但可以接受一些手动适应工作,那么可以选择 Flutter。但无论您选择哪个框架,都可以通过适当的开发工作来实现所需的样式一致性。

英文:

I am trying to find out which framework, Flutter or React Native, is more self-adaptive in terms of native style per platform ( e.g on Android you have checkbox, on iOS a switch ). In another words, in which framework you have to differentiate manually less between 2 platforms, for example isAndroid ? checkbox : switch. After doing some research it seems that React-Native is more self-adaptive than Flutter, but also React Native has less pre-built components. So you have to build more yourself. Flutter, on the over hand, has more pre-built components ( widgets ), but is not self-adaptive at all as it heavily embraces material design ( Android style ). So the developer has to specifically tell Flutter " okay, here differentiate between iOS and Android ".

However, I am unsure about the above statements as I have made them myself by filtering out the information on the web. Therefore, I would like to get your opinion. Which framework is more native in terms of style out of the box without a need to differentiate between the platform manually?

P.S For me there is no difference wether an exact copy of an element is drawn pixel-by-pixel or it's an actual UI-element received via system-call as long as it looks the same.

答案1

得分: 2

Both flutter and react native has rich UI widget ready to be used in all modern apps. Some of them are part of the platform, others are available as third-party libraries developed by other programmers.

Although the two are not the same, because they both have rich UI, it becomes very difficult to predict their difference. But in terms of UI nativeness style out of the box, below is how they differ:

The rendering engine of Flutter controls each and every pixel it renders on the screen, but react-native mainly relies on system calls. So based on this, I will assume the answer to your question is React-Reactive.

英文:

Both flutter and react native has rich UI widget ready to be used in all moden apps. Some of them are part of the platform, others are available as third-party libraries developed by other programmers.

All though the two are not the same but because they all have rich UI it becomes very for one to predict their difference. But in terms of UI nativeness style out of the box below is how they differ:

The rendering engine of Flutter controls each and every pixel it renders on the screen But react-native mainly relies on system calls. So based on this, I will assume the answer to your question is React-Reactive.

答案2

得分: 0

Flutter有自己的渲染引擎,可以控制屏幕上的每个像素,而React Native则依赖于系统调用,即原生UI元素。所以,回答你的问题是React Native。

"问题:" "但基于平台的设计有多自适应呢?无论是一个逐像素绘制的版本,看起来完全像原生UI元素,还是通过系统调用接收的实际UI元素。"

即使在这种情况下,我觉得答案也不会改变。假设你正在构建一个Flutter应用程序,为了适应平台差异,你需要显式地检查,然后使用所需的小部件。而在React Native应用程序中,你不需要显式地检查,只需使用一个React元素,其余的一切都由系统完成。如果在Android上,它会显示一个Material按钮,如果在iOS上,它会显示一个Cupertino按钮。

英文:

Flutter has its own rendering engine which controls each and every pixel it renders on the screen while react native relies on system calls, that is native ui elements. So yeah, the answer to your question is React Native

Question:- "But how self-adaptive is the design based on the platform. Be it a drawn pixel-by-pixel version which looks exactly like native UI element or an actual UI element received via system-call."

In that case too, i feel the answer would not change. Suppose you are building flutter app, to embrace the platform differences you need to explicitly check and then use a desired widget. While in a react native app, you need not explicitly check and just use a react element and rest everything is done by the system. if it is on android, it would display a material button, if on iOS, it would display a cupertino button

huangapple
  • 本文由 发表于 2023年4月17日 13:14:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/76031899.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定