2

I am learning qooxdoo framework and I am going to develop web app on mobile device. However here comes a problem. I do not know how to set the background color for qx.ui.mobile.core.Widget. In terms of qx.ui.core.Widget(Another class, I think this is for desktop application), there are methods to set background color. However, for qx.ui.mobile.core.Widget which is used for developing mobile app, I can find any method in the API reference. I am trying to do this by 'addCssClass()' method, it works for label and so on, however, it is not working for composite widget. By default, the background image of mobile app is the image used in iPhone group style tableview. However, what I am trying to do is to modify the background image to a pure background color. I do not know how to accomplish that, can anyone give me some ideas? Thank you!

Phineas Lue
  • 317
  • 4
  • 15

1 Answers1

1

there are several ways to alter a qx.Mobile widget:

if you use the "getContainerElement()" method, you get the HTML element directly.

There you can set any attribute, you could set in plain HTML, too.

Another possibility is to add a class, as you mentioned: "addCssClass("foo")"

You just have to add your css selector statement to your projects resource folder:

.. resource/ yourproject /css/styles.css

.foo{
  background-color:red;
}

or you could even set the style with brute force, through http://demo.qooxdoo.org/current/apiviewer/#qx.bom.element.Style set()

Now choose your weapon =)

czuendorf
  • 853
  • 6
  • 9
  • Thank you,this is helpful. Now I can set the style of almost all mobile widget, However, I still can not modify the default background(iPhone style background) of my app. I tried add these line to the Application.js, 'this.getRoot().addCssClass("white-background");'. There is no error, but it just not works. – Phineas Lue Oct 26 '12 at 02:45
  • You have to change the background of your NavigationPage, and not of the root of mobile App. The root is always overlayed by a NavigationPage. So, just add your class to your NavPage, and everything should work fine. – czuendorf Oct 26 '12 at 08:08