Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sencha touch 2 Secha touch2:为平板电脑中的窗体面板设置背景图像_Sencha Touch 2_Background Image - Fatal编程技术网

Sencha touch 2 Secha touch2:为平板电脑中的窗体面板设置背景图像

Sencha touch 2 Secha touch2:为平板电脑中的窗体面板设置背景图像,sencha-touch-2,background-image,Sencha Touch 2,Background Image,您好,我是sencha touch2的新手,在设置背景图像时遇到问题。我在平板电脑上看不到完整的图像,底部已经被切断。 以下是我的看法: Ext.define('Test.view.LoginPage', { extend: 'Ext.form.FormPanel', xtype: 'loginPage', config:{ styleHtmlContent:'true', scrollable:'false', styl

您好,我是sencha touch2的新手,在设置背景图像时遇到问题。我在平板电脑上看不到完整的图像,底部已经被切断。 以下是我的看法:

Ext.define('Test.view.LoginPage', {
    extend: 'Ext.form.FormPanel',
    xtype: 'loginPage',

    config:{
        styleHtmlContent:'true',
        scrollable:'false',
        styleHtmlCls:'login-Cls',

        html: '<img class="logo" src="resources/images/login_Landscape_BG.png"/>'

    }

});
Ext.define('Test.view.LoginPage'{
扩展:“Ext.form.FormPanel”,
xtype:“登录页面”,
配置:{
styleHtmlContent:“true”,
可滚动:'false',
styleHtmlCls:'login-Cls',
html:'
}
});
我是否需要将平板电脑添加到profiles文件夹中,作为我的应用程序仅针对平板电脑的目标。
你能帮帮我吗。谢谢

不要使用
html
,您可以尝试使用
样式
来设置完整的背景图像:

style: 'background-image: url("resources/images/sesto-exterior.jpg"); background-size: 100% 100%;'

FWIW,我必须遵循这个建议:

并将其用于我的CSS(首先将TxPanel cls添加到表单面板): .TxPanel.x-scroll-container{ 背景:url('img/txbackground.png')重复中心; }

但是,哎呀。这是一个相当丑陋的黑客:-P

试试这个(使用样式配置而不是html配置):


请确保您的图像url是正确的,我的代码只是一个示例。仅供参考,这在sencha touch 2.0下不起作用。样式需要放在Sencha决定放置该样式的下方的scrollview上:-(
Ext.define('Test.view.LoginPage', {
    extend: 'Ext.form.FormPanel',
    xtype: 'loginPage',

    config:{
        styleHtmlContent:'true',
        scrollable:'false',
        styleHtmlCls:'login-Cls',
        style: 'background-image:url(resources/images/login_Landscape_BG.png);background-repeat:no-repeat;background-size:100% 100%;'

    }

});