What is alternative of DIV in NativeScript?

99封情书 提交于 2019-12-10 12:25:09

问题


What is alternative of DIV in NativeScript?

How to use block inline with content inside?


回答1:


Within Browser the behaviour div is determined by display CSS attribute.

For example, by default it's block and vertical which is similar to StackLayout with orientation set to vertical. When you make it inline, that's more like a horizontal layout, so again could be StackLayout with orientation set to horizontal.

There is again flex, we also have an equivalent in NativeScript, the FlexboxLayout. If you set position to absolute on div, it can be compared to AbsoluteLayout in NativeScript.

There is also GridLayout, WrapLayout, and DockLayout in NativeScript that serves various purposes.

So the alternative for div here totally depends on what kind of UI / layout you are looking for / how exactly you have styled the div on web.

If you are beginner, https://www.nslayouts.com/ is a good start to know all about NativeScript layouts.



来源:https://stackoverflow.com/questions/55906330/what-is-alternative-of-div-in-nativescript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!