本文介绍了SWT应用程序中Layout的用途是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在SWT应用程序中使用布局是什么,因为我们可以在我们的应用程序中省略它。有什么好处?
解决方案自动布局比手动/绝对布局要少的时间。
首先,总体来说,比绝对布局指定所需属性的布局更少。您可以快速添加,移动或删除自动布局中的项目,而无需调整所有其他项目的绝对位置。
接下来,这些因素有时会使自动布局变得必要: / p>
- 本地化:翻译的标签可以更长或更短,需要布局调整。
- 调整对话框和窗口大小经常需要调整布局。
- 如下面的@Daniel第一个注释,控件在不同的平台上可能有不同的大小。
- 字体在平台和
- 动态数据。
- 动态可见度。
What is the usage of the Layout in SWT application, since, we can omit it in our applications. What is the benefit of having it?
解决方案Automatic layout requires less of your time than manual/absolute layout.
First, it's less effort overall to specify a layout with desired properties than an absolute layout. You can quickly add, move or remove items in an automatic layout, without tweaking the absolute positions of all other items.
Next, these factors sometimes make automatic layout necessary:
- Localization: Translated labels can be longer or shorter, requiring layout adjustments.
- Resizing dialogs and windows frequently requires adjusting the layout.
- As @Daniel first notes below, controls may have different sizes on different platforms.
- Fonts may differ among platforms and users.
- Dynamic data.
- Dynamic visibility.
更多推荐
SWT应用程序中Layout的用途是什么?
发布评论