lazarus LAMW开发安卓APP时,GUI如何布局?
- 可视组件请配置这些属性:
- Anchor
- PosRelativeToParent
- PosRelativeToAnchor
- LayoutParamHeight
- LayoutParamWhidth
- 例
- 1 - 在LAMW Form上放置一个jTextView组件并设置属性:
PosRelativeToParent rpCenterHorizontal = [True] rpTop = [True] Text = GUI Design WYSIWYG (Because only Position Relative to Parent(form) is need to localize jTextView1)
- 2 - 在LAMW Form上放置一个jEditText组件并设置属性:
Anchor = jTextView1 LayoutParamWidth = lpTwoThirdOfParent PosRelativeToAnchor raBelow = [True] PosRelativeToParent rpCenterHorizontal = [True] Text = Ok (Because we want it to be bellow the jTextView1)
- 3 - 将jButton组件放在 LAMW 窗体上并设置属性:
Anchor = jEditText1 LayoutParamWidth = lpTwoThirdOfParent PosRelativeToAnchor raBelow = [True] PosRelativeToParent rpCenterHorizontal = [True] Text = Sample (Because we want it to be bellow the jEditText1)
- 4 - 提示:
要更改可视组件的宽度/高度,应配置LayoutParamWhidth和LayoutParamHeight!