cancel
Showing results for 
Search instead for 
Did you mean: 

How to make UI element always occupy the complete width of screen?

Former Member
0 Kudos

Hi All,

in container kind of UI elements, if it's a maxtix layout, there's a property " stratch horizontally" , I've tried this, but it's not working as expected. And another common property" width of each element ", I've also tried to set it to 100%, still it's not working.

And i think it'll be a huge effort to set these property for many UI elements, coz you know you'll have additional transparent container to organize UI elements better.

So anyone knows a easier way to take full advantage of the screen?

Regards,

Aaron

Accepted Solutions (1)

Accepted Solutions (1)

Sharathmg
Active Contributor
0 Kudos

Hello,Aaron,

Firstly, remove all the width settings from all individual elements in the container and also for container.

Then, set the width to 100% to just teh container and use the stretch settings appropriately. If there are multiple elements in the Container with matrix layout, then for the elements in the sec/third rows( if elements are arranged in multiple rows) watch for the cols-layout property.

The best way to get a grip of layout, is trial and error. Try multiple options and choose the one that fits your requirement as its difficult to get teh exact layout without manipulation like, Invisible Elements etc.

Regards,

Sharath

Former Member
0 Kudos

Hi Sharath,

Thanks for your solution. I've tried it and it's working.

And one comment: if the view contain a view container whose content is from an interface view of a reused component,

you must do the same to the root container of the reusded component as well. So that the UI elements will be stretched.

Regards,

Aaron

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Aaron,

I would suggest you to use "cellbackgrounddesign" layout property of the ui element. you would be able to realize the layout in a much better way. Just choose value other than "transparent".

Regards

Anurag Chopra

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You have to consider the parent containers - including the Root UI element and their width and stretching settings. In general it isn't usually different to get content to fill the width but it can also depend upon which layout types you are using as well.