Font size in App Designer Tabs

42 次查看(过去 30 天)
Benjamin Berger
Benjamin Berger 2017-8-24
Nearly every App Designer component (like uibutton or uieditfield) has a property "FontSize". However, neither uitabgroup nor uitab has this property.
Is there any hack to manipulate the font size of a tab group in App Designer?

回答(2 个)

Paul Elliott
Paul Elliott 2024-7-5
I know this is an old post. But I've searched for an answer numerous times. At the time of posting this,83 others had read this post in the past 30 days at this time. I am maybe 5 of those.
First, Matlab's GUI leaves a lot to be desired. There really is no excuse for not developing a set of 'properties' that allow the font size in the tabs to be changed. But after 7 years, it is obviously not a priority, and doubtful to be changed.
I find that the tabs are the easist way to organize a program with several options. They are integral in our GUI's for simplicity. With that we had to find a solution that worked. I've read solutions that suggest simply enabling and disabling things based on a button but that creates a total mess when trying to layout the GUI. This is a goofy work around but a simple one. It maintains the use of the tab group and does not require any 3rd party control apps etc. The simplicity of this and the fact that Matlab has never suggested this as a solution, at least not that I've found, seems to support the notion that GUI's are an afterthought for Mathworks.
Our solution is to create a button group and simply overlay the actual tab selectors. We then change tabs to display based on the button that is pushed using callback functions on the individual buttons. You can simply delete the label, "button group" that Matlab automatically displays, and then end up with 1 box within which the buttons can be placed.
I attached 1 image with the button group above a tab group, and another where the button group has been placed over the tab selectors. For exageration, I made the buttons 25pt font and the tabs remained their base 12pt font.
I hope this helps some people. I'm interested in better solutions.

Mabin Mariam Joseph
This capability is not available in MATLAB.
There is third-party toolbox that allows changing the font size of "uitab" objects called GUI Layout Toolbox:
https://www.mathworks.com/matlabcentral/fileexchange/47982-gui-layout-toolbox
You can download this toolbox and install it into MATLAB to use.
You can create a TabPanel using uix.TabPanel and then change its FontSize property.
  5 个评论
Adam Gogacz
Adam Gogacz 2022-10-10
I went over to Python a few years back because MATLAB was just too restrictive.
Philipp Rost
Philipp Rost 2022-11-8
ridiculous answer, and t's even worse, because the behavior of this tabgroups has changed from 2020b to 2022b. Now in 22b the tabgroub will no longer expand it's width. Therefore, from now on I can no longer read the full content of my tabs.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by