我第一次玩过Sencha Touch,但是在设置图像(即中心)和文本(即制作一定尺寸/颜色)方面遇到困难。
有人可以告诉我在哪里添加样式标签。
示例项如下:
// This is the home page, just some simple html
{
title: 'Home',
iconCls: 'home',
cls: 'home',
scrollable: true,
style: 'text-align:centre',
html: [
'<img height=260 src="http://upload.wikimedia.org/wikipedia/commons/4/4a/Logo_2013_Google.png"/>',
'<h1>Welcome to the Demo HTML5 App</h1>',
"<p>Built with Sencha Touch</p>"
].join("")
}
这里的想法是不要使用STYLE标签...您正在为组件分配一个"CLS",它只是一个 CSS 类。使用 CSS 构建样式:
.home img {}
.home h1 {}
.home p {}
我同意 arthurkay 的观点,但如果你想使用内联样式,你应该改变......
style: 'text-align:centre'
。自。。。
style: 'text-align:center'