uitab.
创建选项卡式面板
描述
t = uitab
在选项卡组中创建一个选项卡并返回标签
目的。如果没有标签组,Matlab®calls the数字
function to create a figure. Then it creates a tab group in that figure, and places the tab inside the tab group.
t = uitab(
specifies tab property values using one or more name-value pair arguments.姓名,Value
)
t = uitab(
creates the tab in the specified parent container. The parent container can be a tab group in a figure created with either the父
)数字
要么Uifigure.
功能。财产价值uitab.
vary slightly depending on whether the app is created with the数字
要么Uifigure.
功能。For more information, see姓名-Value Pair Arguments。
例子
图中两个选项卡
Create a figure containing a tab group and two tabs.
f = figure; tabgp = uitabgroup(f,'Position',[.05 .05 .3 .8]); tab1 = uitab(tabgp,“标题”,'设置');tab2 = uitab(tabgp,“标题”,'选项');
Get the title of the first tab.
tab1.Title
ans = Settings
可滚动的选项卡
The可滚动
属性使能滚动具有其边界外部的组件的选项卡中。只有在父选项卡组在创建的图形中时才可能滚动Uifigure.
功能。App Designer uses this type of figure for creating apps.
Create a tab group containing one tab. Add six UI components to the tab, with the first three lying outside the upper border of the tab.
fig = uifigure; tg = uitabgroup(fig,'Position',[20 20 196 145]); t = uitab(tg,“标题”,'Member Information');ef1 = uieditfield(t,'文本','Position',[11 165 140 22],'Value','名');ef2 = Uieditfield(T,'文本','Position',[11 140 140 22],'Value','Last Name');ef3 = Uieditfield(T,'文本','Position',[11 115 140 22],'Value','地址');dd = uidropdown (t)'Position',[11 90 140 22],'Items',{'Male','Female'});cb = uicheckbox(t,'Position',[11 65 140 22],'Text','成员');B = UIBUTTON(T,'Position',[11 40 140 22],'Text','发送');
通过设置滚动滚动可滚动
property of the tab to'on'
。默认情况下,滚动框显示在顶部。
t.Scrollable ='on';
Input Arguments
姓名-Value Arguments
例子:uitab('title','选项')
指定选项卡标题是选项
。
Specify optional comma-separated pairs of姓名,Value
论点。姓名
is the argument name and价值
是相应的价值。姓名
必须出现在单引号内(''
). You can specify several name and value pair arguments as姓名1,Value1,...,NameN,ValueN
。
Note
此处列出的属性是可用属性的子集。对于完整列表,请参阅标签特性。
标题
—标题
字符向量|字符串标量|categorical array
标题,指定为字符向量,字符串标量或分类数组。如果将此属性指定为分类数组,则MATLAB仅显示数组中的第一个元素。
MATLAB不会解释垂直斜杠('|'
) character as a line break, it displays as a vertical slash in the title.
如果要指定Unicode®字符,将Unicode十进制代码传递给char
功能。For example,['Multiples of ' char(960)]
displays as乘iples of
π。
BackgroundColor
—背景颜色
[0.94 0.94 0.94]
(默认)|RGB三重态|hexadecimal color code|'r'
|'G'
|'B'
|......
背景颜色, specified as an RGB triplet, a hexadecimal color code, or one of the color options listed in the table.
RGB三元组和十六进制颜色代码对于指定自定义颜色很有用。
An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range
[0,1]
;例如,[0.4 0.6 0.7]
。十六进制颜色代码是字符向量或以哈希符号开头的字符串标量(
#
)接着是三个或六个十六进制数字,可以从0
到F
。值不区分大小写。因此,颜色代码'#ff8800'
,'#ff8800'
,'#F80'
, and'#f80'
are equivalent.
Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.
Color Name | 简称 | RGB Triplet | Hexadecimal Color Code | Appearance |
---|---|---|---|---|
“红色” |
'r' |
[1 0 0] |
'#FF0000' |
|
'green' |
'G' |
[0 1 0] |
'#00FF00' |
|
'蓝色' |
'B' |
[0 0 1] |
'#0000FF' |
|
'cyan' |
'C' |
[0 1 1] |
'#00ffff' |
|
'magenta' |
“米” |
[1 0 1] |
'#ff00ff' |
|
'黄色的' |
'y' |
[1 1 0] |
'#FFFF00' |
|
'黑色的' |
'k' |
[0 0 0] |
'#000000' |
|
'white' |
'w' |
[1 1 1] |
'#FFFFFF' |
|
以下是RGB三元组和用于默认颜色MATLAB在许多类型的图中使用的默认颜色的十六进制颜色代码。
RGB Triplet | Hexadecimal Color Code | Appearance |
---|---|---|
[0 0.4470 0.7410] |
'#0072bd' |
|
[0.8500 0.3250 0.0980] |
'#D95319' |
|
[0.9290 0.6940 0.1250] |
'#EDB120' |
|
[0.4940 0.1840 0.5560] |
'#7E2F8E' |
|
[0.4660 0.6740 0.1880] |
'#77AC30' |
|
[0.3010 0.7450 0.9330] |
“# 4 dbeee” |
|
[0.6350 0.0780 0.1840] |
'#A2142F' |
|
Position
—选项卡的位置和大小
[左下宽度]
此属性是只读的。
选项卡的位置和大小,作为表单的四元素向量返回[左下宽度]
。This table describes each element in the vector.
元素 | 描述 |
---|---|
left |
距离选项卡组内左边缘的距离组到选项卡的内部左边缘 |
底部 |
Distance from the inner bottom edge of the tab group to the inner bottom edge of the tab |
宽度 |
选项卡右侧和左下内边缘之间的距离 |
高度 |
Distance between the top and bottom inner edges of the tab |
All measurements are in units specified by the单位
property.
Note
这些是在使用时考虑的一些重要观点Position
财产:
Position
值受标签标题的长度的影响标签Location
property of the parent标签Group
目的。Position
值相对于drawable area父母标签Group
,这是其边界内的区域。If the tab is in a grid layout manager, the value of the
Position
property is not immediately updated. To use thePosition
要调整选项卡子项相对于标签大小的值,请使用aSizechangedFCN.
callback.
单位
—测量单位
'pixels'
|'normalized'
|'英寸'
|'厘米'
|“点”
|......
测量单位, specified as one of the values in this table.
单位价值 | 描述 |
---|---|
'pixels' (默认) |
像素的距离与Windows上的系统分辨率无关®和Macintosh.systems:
在Linux上®systems, the size of a pixel is determined by your system resolution. |
'normalized' |
These units are normalized with respect to the parent container. The lower-left corner of the container maps to |
'英寸' |
英寸。 |
'厘米' |
Centimeters. |
“点” |
Points. One point equals 1/72nd of an inch. |
The recommended value is'pixels'
,因为大多数MATLAB应用程序构建功能测量像素的距离。
数字
-Based Apps
For tabs in apps created using the数字
function, the default value of单位
is'normalized'
。
此外,您可以指定单位
as'characters'
。字符单元基于图形根对象的默认UIControl字体:
字符宽度=字母的宽度
x
。字符高度=两行文本的基线之间的距离。
To access the default uicontrol font, useget(groot,'defaultuicontrolFontName')
要么set(groot,'defaultuicontrolfontname')
。
版本sion History
matlab命令
You clicked a link that corresponds to this MATLAB command:
在MATLAB命令窗口中输入它来运行命令。Web浏览器不支持MATLAB命令。金宝app
Select a Web Site
选择一个网站,以便在可用的地方进行翻译内容,并查看本地活动和优惠。根据您的位置,我们建议您选择:。
You can also select a web site from the following list:
如何获得最佳网站性能
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina(español)
- Canada(英语)
- United States(英语)