Views inside Scrollview return wrong Top values

thedesolatesoul

Expert
Licensed User
Longtime User
Sorry for not posting in SO, but I havent gotten used to it, and I dont understand all the limitations on commenting and things like that.

My problem is related to b4a 1.6 so if it has been fixed in 1.7 then i wouldnt know.

I load a layout in a Scrollview's panel.
In Activity_create I generate another label and add the view to the SV's panel.
I try to set the new label exactly onto another view, but the 'TOP' value is different and the new label appears a lot higher.

I will try to post an example of my problem soon.
 

thedesolatesoul

Expert
Licensed User
Longtime User
It should not really be a scaling issue.
Once you load a layout all the views should have already be scaled to the new screen dimensions. But now this view is inside a scrollview.
I do not use values to specify the dimensions, I just do something like:
label1.top = edittext1.top ...and so on for left,width and height
Although left, width and height are fine, the 'top' value is not.

I tried to create a project to show the problem but (un)fortunately it works correctly!!!
hmm...i need to look at this more closely
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
Just a guess, check the label's parent; is activity or scrollview
Parent does not appear as a property in the Intellisense in the code window.

So basically, how is it that:
Two views have the SAME Top value, as I am seeing through the logs.
But they appear in different places?

Trying to figure out what case this might happen in?
Does the Designer detect a different scale then the emulator at runtime?
It doesnt look like that because they both show a density of 0.75
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Where do expect to see lbl ?
etEveryDay belongs to the pnlSchedule panel and the etEveryDay.Top property is 124 !
Exactly what you get in the logs, and that's the position you see lbl in.

Are you shure that you are looking for the right reference view ?

Best regards.
 
Upvote 0
Top