Languages

Menu
Sites
Language
How to layout or position objects relatively?

I have two objects ObjA and ObjB:

how to align ObjA's left-bottom corner with ObjB's center?

how to align ObjA's right-top corner with ObjB's left-bottom corner?

Thanks.

Responses

10 Replies
Vikram

Hi, 

Seems in Tizen native app, no such c api can do this.

Possible the edc layout can do this, define a group with two swallow part, use rel2 & rel2  to define them relative position. 

 

Jean Yang

Hi, 

Just for more easy to understanding the layout, you can create the Sample Alignment UI sample, and find the .edc file which the content I have list below, please pay attention to the code :

               rel1.to: "bg_rect";
               rel2.to: "bg_rect";
               align: 0.0 0.5;

collections {
   group { name: "main";
      parts {
         part { name: "bg_rect";
            type: RECT;
            scale: 1;
            description { state: "default" 0.0;
               fixed: 1 1;
               rel1 { relative: 0.0 0.0; }
               rel2 { relative: 1.0 1.0; }
               color: 0 0 0 255;
            }
         }
         part { name: "middle_container_base";
            type: RECT;
            scale: 1;
            description { state: "default" 0.0;
               max: 50 50;
               fixed: 1 1;
               rel1.to: "bg_rect";
               rel2.to: "bg_rect";
               align: 0.5 0.5;
               color: 0 255 0 128;
            }
         }
    .........

 

roc john

Like the illustration, The green one is ObjA and blue one is ObjB,

how to align ObjA's left-bottom corner with ObjB's center?

how to align ObjA's right-top corner with ObjB's left-bottom corner?

Thanks.

roc john

Why i can't past picture to reply this message? every time i got spam filter warning!

Jean Yang

Hi, 

I think you can try diffterent web broswer, then upload again.

Jean Yang

Hi, 

Do you try the offset parameter? you can try it on 

 https://developer.tizen.org/documentation/guides/native-application/ui/edje

 

 

roc john

roc john

I've tried relative and offset, neither way can move part of ObjB outside ObjA.

roc john

The part of ObjB outside ObjA are clipped.

colin Rao

Hi,

Please share you edc code here, that's i can take some testing to check what's wrong.