B4J Question [BANano] [SOLVED] Parent Child Relationship with custom views

Mashiane

Expert
Licensed User
Longtime User
Ola

As per note:

Before we start using our views, a quick note: as currently B4J Custom views can only set their parent to main, make sure there is some space between each view to allow BANanos own algorithm to determine who is the parent. The absolute position of a view in the Designer has no relevance in BANano anyway.

I have tried to do this but the parent child relationship is not working for me

pc.png



This is the result

output.png


vcontent is supposed to be a child of vapp, how can I achieve this please. Is there another way that we can use, perhaps via code to set the parent?

This is the console log of getHtml.

B4X:
<div id="app" class="" style=""></div><v-content id="vcontent" class="" style=""><v-app-bar id="vappbar" class="" style=""></v-app-bar></v-content>

Thanks
 

alwaysbusy

Expert
Licensed User
Longtime User
The algorithm seems to work: vappbar is 'inside' vcontent in the Abstract Designer so vcontent is the parent of vappbar.

vcontent is supposed to be a child of vapp
do you mean the tag with id="app"? I don't see a component vapp.

Is this the result you would like?
B4X:
<body>
   <div id="app" class="" style="">
      <v-content id="vcontent" class="" style="">
         <v-app-bar id="vappbar" class="" style=""></v-app-bar>
      </v-content>
   </div>
</body>

This would be archieved by loading the layout to the #app tag:
B4X:
BANano.LoadLayout("#app", "MyLayout")

Alwaysbusy
 
Upvote 0
Top