BlackBerry10 Cascades之DockLayout
来源:互联网 发布:java课程设计 编辑:程序博客网 时间:2024/05/21 01:58
DockLayout,可以排列控件在不同的位置,例如上,下,左,右,居中等。
类继承关系:
C++代码实例:
01
Container* pContainer =
new
Container();
02
DockLayout *pDockLayout =
new
DockLayout();
03
pContainer->setLayout(pDockLayout);
04
05
DockLayoutProperties* pProperties = 0;
06
07
// Position button 1 horizontally centered and docked to the top
08
// of the container
09
Button* pButton1 = Button::create().text(
"Button1"
);
10
pProperties = DockLayoutProperties::create();
11
pProperties->setHorizontalAlignment(HorizontalAlignment::Center);
12
pProperties->setVerticalAlignment(VerticalAlignment::Top);
13
pButton1->setLayoutProperties(pProperties);
14
15
// Position buttons 2 vertically centered and docked to the
16
// right edge of the container
17
Button* pButton2 = Button::create().text(
"Button2"
);
18
pProperties = DockLayoutProperties::create();
19
pProperties->setHorizontalAlignment(HorizontalAlignment::Right);
20
pProperties->setVerticalAlignment(VerticalAlignment::Center);
21
pButton2->setLayoutProperties(pProperties);
22
23
pContainer->add( pButton1 );
24
pContainer->add( pButton2 );
实现效果:
QML代码实例:
01
import bb.cascades 1.0
02
03
Page {
04
content:Container {
05
id: containerID
06
layout: DockLayout {
07
08
}
09
Button {
10
text:
"Button 01"
11
layoutProperties: DockLayoutProperties {
12
verticalAlignment: VerticalAlignment.Center
13
horizontalAlignment: HorizontalAlignment.Right
14
}
15
}
16
Button {
17
text:
"Button 02"
18
layoutProperties: DockLayoutProperties {
19
verticalAlignment: VerticalAlignment.Center
20
horizontalAlignment: HorizontalAlignment.Center
21
}
22
}
23
Button {
24
text:
"Button 03"
25
layoutProperties: DockLayoutProperties {
26
verticalAlignment: VerticalAlignment.Fill
27
horizontalAlignment: HorizontalAlignment.Fill
28
}
29
}
30
31
Button {
32
text:
"Button 04"
33
layoutProperties: DockLayoutProperties {
34
verticalAlignment: VerticalAlignment.Bottom
35
horizontalAlignment: HorizontalAlignment.Right
36
}
37
}
38
}
39
}
实现效果:
http://www.onmoso.com/blackberry/281.html
- BlackBerry10 Cascades之DockLayout
- DockLayout布局
- BB10 Cascades介绍之Image和ImageTracker
- BlackBerry10的起航
- BlackBerry10 开发环境搭建
- blackberry10入门经历
- BlackBerry10开发环境搭建
- BlackBerry10 学习Signals和Slots
- blackberry10平台下Phonegap开发
- vehicleDectection with Haar Cascades
- RIM再度暗示将对BlackBerry10授权
- 每日一篇BlackBerry10开发——序
- BlackBerry10(虚拟机)开发环境配置
- 设置 Unity,为 Blackberry10 设备构建应用程序
- 姚博文 blackberry10 微信 朋友圈 打不开
- BB10 Cascades:如何查看Cascades IDE本身的日志。
- BB10 Cascades Beta3已经发布!
- BlackBerry Cascades 正式版已经发布!
- 1935. 二叉树重建(根据先序遍历和中序遍历重建二叉树并进行广度优先遍历)
- 结构体数组在ARM2440经典用法
- 1940. Ordering Tasks(拓扑排序,用set装住入度为0的点)
- 软件需求分析
- 组件连接/绑定中“->”、“<-”与“=”的区别
- BlackBerry10 Cascades之DockLayout
- bbed破坏数据文件
- AJAX在ASP.NET中的应用(一)——原始的AJAX
- Robot(计算最短距离,用Dijkstra算法)
- unity3D C#脚本实现鼠标拖动物体
- C++(-)命名规则
- Robot(Dijkstra算法计算单点源,没优化)
- 计算无向图中连通块的数目
- EM算法笔记(a note on the EM algorithm)