B4J Question B4XImageView size on start

LucaMs

Expert
Licensed User
Longtime User
In B4XPage_Created of B4XMainPage I have this code:
B4X:
    xivSnapshot.mBase.Width = 0
    Log("On start: "  & xivSnapshot.mBase.Width)
The log does not report zero but the initial width of the View (350, just to say).

I tried many things:

SetLayoutAnimated(0, ...
Sleep(....)
xivSnapshot.Update
 

teddybear

Well-Known Member
Licensed User
Do you mean this?
B4X:
    Log("Not set: "&B4XImageView1.mBase.Width)
    B4XImageView1.mBase.Width=0
    Log("Set: "&B4XImageView1.mBase.Width)
Logs
B4X:
Not set: 270
Set: 0
 
Upvote 0

teddybear

Well-Known Member
Licensed User
It is B4J, it works in b4xpages project.
I don't know why it does not work as you said at post#1
 

Attachments

  • Project.zip
    8.8 KB · Views: 59
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
It is B4J, it works in b4xpages project.
I don't know why it does not work as you said at post#1
This is increasingly strange, because I had tried it in a B4XPages-B4J project, initially using SetLayoutAnimated with zero duration (I only needed to resize the B4XImageView, I didn't need to display the animation).

Something really strange happens using SetLayoutAnimated with 0 duration, but it's a long story to "tell".
 
Upvote 0
Top