aida
aida

Reputation: 163

LWUIT : Image as Background in Form

I have started using LWUIT which sounds interesting , i have made a form and has simply added an image to its background , my problem is that the image is getting streched and looks bad :D is there any way to set an image not to get stretshd on a form or any other component ?

Upvotes: 0

Views: 1577

Answers (1)

Shai Almog
Shai Almog

Reputation: 52745

This depends on the version of LWUIT you are using. In 1.4 you could define bgType in the Style to be BACKGROUND_IMAGE_ALIGNED and then define the bgAlign value to whatever you want (there are many types/alignments).

The latest SVN and upcoming 1.5 simplifies this by removing bgAlign and adding to bgType all the alignment/tiling possibilities e.g. BACKGROUND_IMAGE_TILE_VERTICAL_ALIGN_RIGHT or BACKGROUND_IMAGE_ALIGNED_TOP_LEFT etc...

You can edit all of these visually in the resource editor using the theme.

Upvotes: 2

Related Questions