开发者

Appcelerator: Resize Backgroundimage from window when the orientation change?

开发者 https://www.devze.com 2023-03-13 05:38 出处:网络
i hope you can help me. I want that the Background image fit to the screen when the orientation changes.

i hope you can help me.

I want that the Background image fit to the screen when the orientation changes.

At the Moment i looks like this:

http://i.stack.imgur.com/254IM.png

When i click on the Picture a new window will open with the big picture as background. As you see below that only works well when i turn the ipad left or right. At the portrait mode the picture doesn´t fit very well to the screen.

ttp://i.imgur.com/hqP8y.png

http://i.stack.imgur.com/RGMWm.png

Here is the Code for the opening window when i click a picture:

     var button2 = Titanium.UI.createButton({
     backgroundImage:'./images/4sm.png',
        height:hoehe,
        width:breite,
        top:oben,
        left:links

     });
     scrollView.add(button2);

     button2.addEventListener('click', function()
     {

        var w2 = Titanium.UI.createWindow({
            backgroundImage:'./images/4.png'
        });
        w2.addEventListener('click', function()
        {
            w2.close();
        });

        w2.open();
    开发者_StackOverflow });

How can i change the backgroundimage properties when the ipad is in landscape or portrait mode?

Thank you so much!


I would take a look at this guide here on orientation change handlers.

0

精彩评论

暂无评论...
验证码 换一张
取 消