Android Question Any tutorial for the new anchors feature in b4a32?

Beja

Expert
Licensed User
Longtime User
The demo on YouTube: shows the
action.. but no information as to how this is done.. I am using v3.2 and the layout is
the same.. it can stretch from the corner but leaving all the views behind (not following
like on the demo video). A little explanation, written or voice will help.
 

DonManfred

Expert
Licensed User
Longtime User
- Create new Design
- In Designer-Main-Window click on AddView in Menu to add a Panel.
- In Designer-Preview-Window (Not the maindesigner-window) rightclick on that panel you just added and use AddView from the contextpopup. Set the anchors and move the View to where it should be.
- Do this some times (adding Views to this Panel and place them)
- Change Panelsize like in Video.

VOILA
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Thanks Manfred, but sorry.. may be I am missing something for sure..
I placed the view from inside the panel by right-clicking on it as you said, then
positioned them in different locations, but still they are not following the panel's movement.
I went to help/about and my version is 3.2
I am moving the panel around and expecting the child views to follow.
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Hi,
What's the difference between adding views from designer and by right-clicking? sorry forgot to ask this.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Hi,
What's the difference between adding views from designer and by right-clicking? sorry forgot to ask this.

I dont know ;-)

I have not used the new Anchors till today. I read your post here and then i tried how that must be.
It could be that this also works from main designer window. I dont know. I just told the way i did it...

But to your video you just posted: I cannot see anything what is other than in my video. I did not size the panel out of the black background in my video. But when i did then it looks like your video!?

See http://www.vdfb.de/downloads/Anchortest2.wmv
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I just tested if it works to add view from designer-main-window....
First i have added a imageview after i marked the panel1 in preview. i set anchors an then resized panel. Works.
Then i have added a new imageview but with NO View selected in preview. Then i marked the new imageview and set the Parent from Activity to Panel1. I resized panel1 and everything happens like expected.

So. It is NOT(!) needed to use the contentmenu in previewwindow!! Sorry for that. i thought it was right.
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
I just clicked on the URL provided by Erel.. and I found the video working exactly as Erel
has described.. but it is not working on my computer.. this is the problem.. so the problem is not with
the video posted by Erel on YouTube.
Attached are two screenshots.. they show what I am talking about. notice the panel covered two buttons
because they belong to the panels, while the the middle button left behind because it belongs to the activity.View attachment 21976View attachment 21977
 
Last edited:
Upvote 0

Beja

Expert
Licensed User
Longtime User
Just download Erel's example of the anchors.. I didn't touch it. It is the one I am trying to understand.

Best,
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
notice the panel covered two buttons
because they belong to the panels, while the the middle button left behind because it belongs to the activity

Problem is that they should move its position (not the one from activity) but the do not, right?
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
What you are doing is wrong, you have to anchor where you want the view to stay, do this:

1- Place BUTTON1 at the top left
2- Place BUTTON2 at the bottom right (and change the anchors to RIGHT, BOTTOM)

Now when you resize the panel you will see the effect you want.
 
Last edited:
Upvote 0

Beja

Expert
Licensed User
Longtime User
Thanks NJDude,
Just a note I didn't place these views.. they came like this in the example and I thought they should run
as expected. Now will change their locations.
 
Upvote 0

Beja

Expert
Licensed User
Longtime User
Oh..
Thank you NJDude..
but how can I adjust little white anchors.. sorry but I didn't read anything about this.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…