NativeScript中DIV的替代方法是什么? [英] What is alternative of DIV in NativeScript?

查看:100
本文介绍了NativeScript中DIV的替代方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

NativeScript中DIV的替代方法是什么?

如何在内部内容中使用块内联?

解决方案

在浏览器中,行为divdisplay CSS属性确定.

例如,默认情况下,它是block和垂直的,与StackLayout相似,而orientation设置为vertical.当您将其设置为inline时,它更像是一个水平布局,因此再次可能是StackLayout,而orientation设置为horizontal.

又有一个flex,我们在NativeScript中也有一个等效的FlexboxLayout.如果在div上将position设置为absolute,则可以将其与NativeScript中的AbsoluteLayout进行比较.

NativeScript中还有GridLayoutWrapLayoutDockLayout,可用于各种目的.

因此,这里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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆