×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jul 2013
    Posts
    1

    Exclamation Can not change button background color

    Hi,

    I can not change button bg color on Asha platform. Here is code:

    Form f = new Form("Testing");
    Button b = new Button("ABC");
    b.getUnselectedStyle().setBgColor(0xff0000);
    b.getSelectedStyle().setBgColor(0xff0000);
    b.getStyle().setBgColor(0xff0000);
    b.getUnselectedStyle().setBgTransparency(255);
    b.getSelectedStyle().setBgTransparency(255);
    b.getStyle().setBgTransparency(255);
    f.addComponent(b);
    f.show();


    Screenshot here: http://www.flickr.com/photos/95995532@N08/9212205841/

    I run example on Nokia Asha SDK 1.0

    Any suggestion is appreciated.

    Thanks.

  2. #2
    Registered User
    Join Date
    Feb 2013
    Location
    Madrid
    Posts
    84

    Re: Can not change button background color

    This type of Button has a background image not a color of background. If you need to change de color to the button and keep in the shape as the capture, you will need to create images with borders like this button and change the color in this images

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    603

    Re: Can not change button background color

    Note that if you use Nokia s40 lwuit SDK then the default themes that comes with it all uses Nokia platform colors (there is a flag in the theme constant tab that is set to true you can set it to false)

  4. #4
    Registered User
    Join Date
    May 2013
    Posts
    12

    Re: Can not change button background color

    Just create a border using the resource editor, remember to assign a width and height according to the size of the button, according to the design guidelines should have 43 px high

  5. #5
    Registered User
    Join Date
    Dec 2012
    Location
    India
    Posts
    264

    Re: Can not change button background color

    A simpler solution would be to change the UIID of the component to something new.This will prevent this particular button from getting the properties of a Button,but will behave like a button.

    eg : b.setUIID("myownbutton");

Similar Threads

  1. How to change color of text in Button ?
    By mahendra_g1 in forum Symbian
    Replies: 5
    Last Post: 2009-12-09, 06:34
  2. How to change background color of EEikColumnListBox
    By praveen.nitdgp@gmail.com in forum Symbian User Interface
    Replies: 0
    Last Post: 2008-07-11, 14:09
  3. How to change the background color of a CAknSingleStyleListBox
    By varssuda in forum General Development Questions
    Replies: 0
    Last Post: 2008-04-25, 04:34
  4. How to change grid's background color
    By ludylu in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-03-19, 05:12
  5. Dynamic change background color
    By s2005 in forum Symbian
    Replies: 0
    Last Post: 2005-11-03, 21:37

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •