StackLayout布局
来源:互联网 发布:研究院与研究生院 知乎 编辑:程序博客网 时间:2024/06/04 19:26
StackLayout布局要求子元素从上到下或者从左到右依次排列
子元素可以使用 HorizontalAlignment 和VerticalAlignment属性 可以指定元素在父容器在横着的还是竖着的位置
如果是RightToLeft排版,则子元素水平布局起作用
import bb.cascades 1.0
Page {
Container {
layout: StackLayout {
orientation: LayoutOrientation.RightToLeft
}
Button {
text: "Button1"
horizontalAlignment: HorizontalAlignment.Left // 从左到右或从右到左排版,水平对齐无效
verticalAlignment: VerticalAlignment.Fill // 1,从左到右,或从右到左排版,垂直对齐有效; 2,VerticalAlignment.Fill在测试版本暂时不起作用
}
Button {
text: "Button2"
verticalAlignment: VerticalAlignment.Center
}
}
}
如果是TopTopBottom排版,则子元素HorizontalAlignment起作用:
import bb.cascades 1.0
Page {
Container {
layout: StackLayout {
orientation: LayoutOrientation.TopToBottom
}
// horizontalAlignment: HorizontalAlignment.Left // 这个属性是管自己元素(Container)而不是子元素们的
Button {
text: "Button1"
horizontalAlignment: HorizontalAlignment.Fill // 1,horizontalAlignment的Fill值起作用; 2,从上到下排版,水平对齐有效
}
Button {
text: "Button2"
horizontalAlignment: HorizontalAlignment.Right
}
}
}
- StackLayout布局
- 自定义层叠布局StackLayout
- SWT:StackLayout(堆栈式布局)
- stackLayout
- SWT(JFace)体验之StackLayout布局
- Xamarin.Forms 用户界面——控件——布局——StackLayout
- StackLayout的使用
- 自定义UICollectionViewLayout(二) ----StackLayout&CircleLayout
- (顶部/底部)导航方案(1)TabBar+StackLayout
- 用Swing制作叠加面板|SWT中的StackLayout实现
- 布局
- 布局
- 布局
- 布局
- 布局
- 布局
- 布局
- 布局
- java中的==和equals()和hashCode()
- POJ 1091 跳蚤 扩展欧拉函数 or 容斥原理
- Oracle分析函数中的分组排名函数用法 Rank Over partition by
- 第一次自己生成静态库
- Android中使用gzip传递数据
- StackLayout布局
- putty链接android设备
- 国际化
- SQL 创建存储过程 语法
- hbase介绍
- 线段树之Poj3264
- 一步一步学习Ubuntu之安装篇
- Android中Activity启动模式详解
- Android 4.2 API 变更