4

I want to to change the header color of nokia lwuit based full touch form and i have tried setTitleComponent method but it is not working. Please also check the following link http://projects.developer.nokia.com/LWUIT_for_Series_40/wiki/UsingSeries40FullTouchFeatures in which it is mentioned we cannot style the header but is it means we cannot change the bgcolor as well or put custom images in the header?

user1001084
  • 115
  • 1
  • 10
  • do you want to recreate the header part to be something like what I did in this question >> http://stackoverflow.com/questions/13597932/lwuit-how-to-show-menu-commands-with-another-button – giripp Dec 02 '12 at 22:37

2 Answers2

2

Note that when using LWUIT for Series 40 port, the default way of running LWUIT apps is a normal-size canvas in Series 40 full touch devices. Thus the Series 40 chrome shows on top of canvas. And there is no way of customising it (other than the title text).

If you want to provide branding elements to the title, the options are: 1. create an additional lable below the Series 40 headerbar 2. run the application in full-screen. We are planning to create a high-level API for this but currently it is already possible using the following trick: ((GameCanvas) (javax.microedition.lcdui.Display.getDisplay(this)).getCurrent()).setFullScreenMode(true); In the latter option you will of course lose the Series 40 full touch layout.

0

Use lwuit source, you can change method visibility if required, this is example what i used to use gradient color

        form.getTitleComponent().getStyle().setBackgroundType(Style.BACKGROUND_GRADIENT_LINEAR_VERTICAL);
        form.getTitleComponent().getStyle().setBackgroundGradientEndColor(Color.GRADIENT_END);
        form.getTitleComponent().getStyle().setBackgroundGradientStartColor(Color.GRADIENT_START);
        form.getTitleComponent().getStyle().setFgColor(Color.WHITE);
        form.getTitleComponent().getStyle().setPadding(10,10,0,0);
        form.getTitleComponent().getStyle().setFont(font);

Here Color is my custom class that is used for color code, you can use your one.

Nirmal- thInk beYond
  • 11,847
  • 8
  • 35
  • 46
  • 1
    are u using it for nokia full touch devices? i need to change the header background... – user1001084 Aug 16 '12 at 04:58
  • 1
    I have used this line of code but unable to change the default background color of the header bar of full touch devices form.getTitleComponent().getStyle().setFgColor(0xffffff); Please suggest. – user1001084 Aug 16 '12 at 20:34
  • I've tried this code but unfortunately it doesn't work. I don't know why. Actually all of your code is make sense, it is the technical constraint from the device? I don't know – giripp Nov 22 '12 at 14:14
  • Ok, I finally get the source code of the Nokia SDK 2.0 but using this methods the header color still being in the same color! What can I do? – Mun0n Aug 12 '13 at 07:00