- uigridlayout: https://www.mathworks.com/help/matlab/ref/uigridlayout.html
- uipanel: https://www.mathworks.com/help/matlab/ref/uipanel.html
Add lines to UI figure
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I'm creating an app in App Designer and using an UI grid element to sort the UI components, arranging them in a table-like manner. Is there a way to add lines or make the lines of the grid element visible? I know that I could use a UI table but my app idea doesn't fit the functionality of the table element.
0 comentarios
Respuestas (1)
Abhishek Chakram
el 11 de Oct. de 2023
Hi Khalil Khalil,
It is my understanding that you want to show the grid lines of the “uigridlayout”. To achieve this, you can use “uipanel” inside “uigridlayout” in the “startupFcn” function of the application. Here is a sample code for the same:
function startupFcn(app)
% Create a UIGridLayout with 2 rows and 2 columns
gridLayout = uigridlayout(app.UIFigure, [2, 2]);
% Create the first UIPanel
panel1 = uipanel(gridLayout);
panel1.Layout.Row = 1;
panel1.Layout.Column = 1;
% Set other properties of panel1 as desired
% Create the second UIPanel
panel2 = uipanel(gridLayout);
panel2.Layout.Row = 1;
panel2.Layout.Column = 2;
% Set other properties of panel2 as desired
% Create the third UIPanel
panel3 = uipanel(gridLayout);
panel3.Layout.Row = 2;
panel3.Layout.Column = 1;
% Set other properties of panel3 as desired
% Create the fourth UIPanel
panel4 = uipanel(gridLayout);
panel4.Layout.Row = 2;
panel4.Layout.Column = 2;
% Set other properties of panel4 as desired
end
You can refer to the following documentation to know more about the functions used:
Best Regards,
Abhishek Chakram
0 comentarios
Ver también
Categorías
Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!