Borrar filtros
Borrar filtros

Center Checkbox nested in a GridLayout in App designer

3 visualizaciones (últimos 30 días)
Zaper
Zaper el 7 de Jul. de 2021
Respondida: Srijith Kasaragod el 1 de Sept. de 2021
Hi,
Is there a way to center the checkbox component which is nested in a gridLayout developed in App Designer. In the attached picture you can see that the checkbox is alligned horizontaly to the left which I want to center.

Respuestas (1)

Srijith Kasaragod
Srijith Kasaragod el 1 de Sept. de 2021
By default, adding a checkbox into grid results in the checkbox being placed towards the left of the grid cell. One of the ways to position it towards the center is by using an additional grid layout of a single row and column inside the parent grid cell and then modifying grid layout to place the child grid accordingly. One possible layout configuration can be:
app.GridLayout2 = uigridlayout(app.GridLayout);
app.GridLayout2.ColumnWidth = {'1x'};
app.GridLayout2.RowHeight = {'1x'};
app.GridLayout2.Padding = [60 10 60 10];
Depending on padding values the single cell grid will be placed, and then adding a checkbox into this grid positions it into the center of parent grid cell. Kindly refer this documetation to understand more about grid layout properties.

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by