Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Developer
Posts: 37
Registered: ‎09-26-2011
My Device: Anything that goes up from JDE 6.0
My Carrier: Anyone

Re: Custom PopupScreen sublayout problem

Ok, after all these months, 3 days ago I stumbled against this problem again.
I found what I think is the solution, but first I want to note down that I have two classes that have almost exact code and one is working fine, and the other is showing what I posted here a long time ago.

 

The problem I think was that I wasn't setting the layoutDelegate()

If you add it as I show in the code below, then it's solved.

 

Solution:

protected void sublayout(int width, int height){
	
	super.sublayout(width, height);

        int barsheight = onebarHeight + anotherbarHeight;
	
        layoutDelegate(Display.getWidth(), 
        Display.getHeight()-barsheight);
	
        setPosition(0, barsheight);
	
        setExtent(Display.getWidth(), 
        Display.getHeight()-barsheight);
}

 The only thing that makes my head ache is that in the other class I don't specify the layoutDelegate() and it's still working properly. 

I don't know if setting applyTheme() void is not working properly or if this is normal behaviour. Well, either way, just do as I said and it will work.