NativeScript中DIV的替代方法是什么? [英] What is alternative of DIV in NativeScript?
问题描述
NativeScript中DIV的替代方法是什么?
如何在内部内容中使用块内联?
在浏览器中,行为div
由display
CSS属性确定.
例如,默认情况下,它是block
和垂直的,与StackLayout
相似,而orientation
设置为vertical
.当您将其设置为inline
时,它更像是一个水平布局,因此再次可能是StackLayout
,而orientation
设置为horizontal
.
又有一个flex
,我们在NativeScript中也有一个等效的FlexboxLayout
.如果在div
上将position
设置为absolute
,则可以将其与NativeScript中的AbsoluteLayout
进行比较.
NativeScript中还有GridLayout
,WrapLayout
和DockLayout
,可用于各种目的.
因此,这里div
的替代方案完全取决于您要寻找哪种UI/布局/您在Web上为div
设置样式的精确程度.
如果您是初学者,则 https://www.nslayouts.com/是一个不错的开始完全了解NativeScript布局.
What is alternative of DIV in NativeScript?
How to use block inline with content inside?
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.
这篇关于NativeScript中DIV的替代方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!