Setting CustomButtonField as Background in black berry - blackberry

can any one tell me how to set custom button field as background in black berry.
Thank you

You can't set a ButtonField as a background. If you are just trying to use an image check out the BackgroundFactory class. Also be aware that setting the background on a MainScreen typically doesn't work -- you'll have to set a background for a VerticalFieldManager and then add that to the Screen.

Related

How to change background color of a UIImagePickerController's Table View?

Using the UIImagePickerController to bring up the following window.
Am able to change the navigation bar color and their text attributes no problem.
How to change the background of this table view's cells AND the background color of this tableView?
Basically all the area that has been painted red is the area I'm trying to change the color of. Please help. Thank you.
UIImagePickerController is not intended to be modified. It should have the system default style and if you modified that, your app will get rejected.
If you want to customize it, you need to look at some custom image picker, not the one that is provided to you by default.

Transparent background like in spotlight search

How to make transparent background for the whole application?
I have such settings for the main view:
But I still get non transperent background on the device
Put a bgView behind your desired view(original view), Set your original view background to clear color. Make bgView background color black and set alpha as desired.
EDIT:
If you meant to make the whole app transparent and show the device wallpaper as bg, then I am pretty sure its not possible.
For Transparency..
*) check Opaque off
*) change alpha depending on yur need.

How to add labelfield on above Imagefield in blackberry

i've one imagefield. i want to show label field on that image filed.
How to show this on blackberry.
i expected like this image.
How to add label field with white background with fill 50%(for transparent effect).
if any sample code snippet. pls give.
Have a Field Manager, and override its width and height by methods sublayout method. and set image as background of this layout.
Now add a label field over this. and Set its background to some semi transparent color, by setting alpha.
Havent applied myself yet, but it should work.
I wouldn't provide any snippet. There are two possible solutions:
Use AbsoluteFieldManager put ImageField on it and put LabelField with transparent background and font color on the top (OS 5+)
Override paint in ImageField and after call super.paint() draw your text with transparent background.
The additional keywords for cases:
BackgroundFactory, Field.setBackground()
Graphics

Use of subpaint() on Mainscreen Doesn't paint child correctly

To get a quick background of the problem please refer to
Create Transparent Mainscreen in Blackberry
.
The problem I am facing is with painting of the child on mainscreen.
I wanted my mainscreen to look transparent/translucent as an original requirement and add my other UI elements e.g. managers/field on top of it.
So the UI elements I am using are 3 BitmapField(s) which should have its thick border created using BorderFactory.createSimpleBorder() with two colors added for Field.VISUAL_STATE_FOCUS and Field.VISUAL_STATE_NORMAL states. all of these BitmapFields are added in their respective HorizontalFieldManger which in turn are added to the screen.
So part of the problem is, when I do navigation across these BitmapFields, "some area" of the border added to the BitmapFields doesn't get painted as per the state (normal, focus) specified.
Other problem is, on torch 9800 when I navigate across from top to bottom or vice versa, i see default scroll happening which should be normal however on each scroll my BitmapField leaves some tail/crack on the screen when movement happened on the scrolling.
None of such things happen when I use normal screen (not use subpaint to make the screen transparent).
Do you have any idea what's happening here..?
Big O
YMMV, but I've made a transparent screen with this:
public class TranslucentScreen extends Screen {
public TranslucentScreen() {
super(new VerticalFieldManager(USE_ALL_WIDTH | NO_VERTICAL_SCROLL));
setBackground(BackgroundFactory.createSolidTransparentBackground(0x000000, 150));
}
protected void sublayout(int width, int height) {
setPosition(0, 0);
setExtent(width, height);
setPositionDelegate(0, 0);
layoutDelegate(width, height);
}
}
This was for a basic popup screen screen I made that had a semi-transparent black background. I added a VerticalFieldManager to the screen that I controlled the background painting on so it would be how I wanted it, and then added my other Fields to that.

Is there a way to set the background color in blackberry?

I would like to chnage the background color.. At first i tried to creat a vertical container, but this did not work becouse the edges wrapped arounbd the content, so there was a big right and left margin.
Ted
You could set the screen background by:
Background myBG = BackgroundFactory.createSolidBackground(Color.RED);
getMainManager().setBackground(myBG);

Resources