Android Question Test B4A3.2 's anchor.

Olaan

Expert
Licensed User
Longtime User
Hi Erel,
I've download a new version and test about anchor feature. I create panel1 and 3 buttons.
The first step,I create button1 on the panel1,the second step,I create button2 by duplicated button1 and the last step,I create button3 as same as do button1. My problem are:
1. after run,I see only button2
2. In designer,button2's parent is activity isn't panel1 as same as button's parent.
 

Attachments

  • TestAnchor.zip
    TestAnchor.zip
    7.1 KB · Views: 322
  • TestAnchor.png
    TestAnchor.png
    5.6 KB · Views: 448
  • WhynotInsidePanel1.png
    WhynotInsidePanel1.png
    23.1 KB · Views: 467
Hi Erel,
I need Delete menu in order to delete view which I don't want. and When I need to bring button2 be front,it's not do.
 

Attachments

  • NeedButton2BeFront.png
    NeedButton2BeFront.png
    5.3 KB · Views: 395
  • ShouldHasDeleteMenu.png
    ShouldHasDeleteMenu.png
    20.2 KB · Views: 471
  • NeedButton2BeFront.zip
    NeedButton2BeFront.zip
    7.1 KB · Views: 311
Upvote 0
You can use Cut to delete a view.

About the "invisible views". Change their anchor to LEFT, TOP and you will see that their dimensions are 0 or negative values.

You should understand how BOTH anchor works. Horizontal BOTH means that the distance to the left edge and the distance to the right edge are constant. This means that the width will change automatically.

Play with the panel width (in the abstract designer). You will see how the width changes together with the panel. If you decrease the panel's width too much the views will disappear.

BOTH should usually used with large views that are close to their parents bounds.
 
Upvote 0
Hi Erel,
I've tried to set button1's parent is activity ,but button2 and button3 still have parent is panel1. Why are button2 and button3 not show? Please test a new sourcecode.

P.S. I think that Bring to Front munu and Send to back menu have problems in post#3,I cann't do them.
 

Attachments

Upvote 0
Hi Erel,
How to control size of button2 is the same size of button1 or size of button3 (I need all of size is equal)
 

Attachments

  • TestAnchor4.zip
    TestAnchor4.zip
    7.1 KB · Views: 332
  • result1.png
    result1.png
    24.5 KB · Views: 438
  • result2.png
    result2.png
    22.8 KB · Views: 430
Upvote 0
Hi Erel,
Your video cann't explain more than I get understand.

Please attached file, I don't see width property(See only height). In H. Anchor or V. Anchor ,I cann't select unAnchored option.
 

Attachments

  • PropertyOfButton2.png
    PropertyOfButton2.png
    20.2 KB · Views: 458
Upvote 0
Hi Erel,
I've succeeded to understand anchored view,but I'm not clearly, I have question about this anchored view tutorial that every views' parent is always activity ,or not ? (in my case which has panel1) Can I set buttons' prarents are panel1,cann't I?
 

Attachments

  • HResult.png
    HResult.png
    27.5 KB · Views: 380
  • VResult.png
    VResult.png
    32.7 KB · Views: 486
Upvote 0
Back
Top