interface in UnityEngine.Experimental.UIElements
切换到手册此接口提供对 VisualElement 样式数据的访问。
如果多个元素符合相同的 USS 规则,从此对象读取属性将从样式数据的共享副本中读取。 向任意属性写入时,目标元素将开始拥有自己的样式数据并停止使用共享副本。 向属性写入会用提供的值覆盖来自 USS 的值,但其他属性仍与来自 USS 的值一致。
alignContent | 当横轴上的子级在此容器内跨越多行时,整个子级区域的对齐方式。 |
alignItems | 此容器横轴上的子级的对齐方式。 |
alignSelf | 与 alignItems 相似,但只用于这一特定元素。 |
backgroundColor | 要在此元素的框中绘制的背景颜色。 |
backgroundImage | 要在此元素的框中绘制的背景图像。 |
backgroundScaleMode | 此元素的框中的背景图像缩放。 |
borderBottomLeftRadius | 这是在此元素的框中绘制圆角矩形时左下角的半径。 |
borderBottomRightRadius | 这是在此元素的框中绘制圆角矩形时右下角的半径。 |
borderBottomWidth | 在布局阶段为此边框的下边缘保留的空间。 |
borderColor | 要在此元素的框中绘制的边框的颜色。 |
borderLeftWidth | 在布局阶段为此边框的左边缘保留的空间。 |
borderRadius | 这是在此元素的框中绘制圆角矩形时每个角的半径。 |
borderRightWidth | 在布局阶段为此边框的右边缘保留的空间。 |
borderTopLeftRadius | 这是在此元素的框中绘制圆角矩形时左上角的半径。 |
borderTopRightRadius | 这是在此元素的框中绘制圆角矩形时右上角的半径。 |
borderTopWidth | 在布局阶段为此边框的上边缘保留的空间。 |
color | 绘制元素的文本时要使用的颜色。 |
cursor | 鼠标指针悬停在某一元素上时要显示的鼠标光标。 |
flex | 在布局阶段,此元素在其父级中的配比。 |
flexBasis | flex 项目的初始主大小,位于主 flex 轴上。根据由 flex 属性确定的 flex 收缩和增长,最终布局可能更小或更大。 |
flexDirection | 容器中用于布局子级的主轴的方向。 |
flexGrow | 指定此项目相对于同一容器中的其余灵活项目将增长多少。 |
flexShrink | 指定此项目相对于同一容器中的其余灵活项目将收缩多少。 |
flexWrap | 当此容器中没有足够的可用空间时,跨越多行的子级放置方式。 |
font | 用于绘制此元素的文本的字体。 |
fontSize | 用于绘制此元素的文本的字体大小。 |
fontStyleAndWeight | 用于绘制元素文本的字体样式和粗细(正常、粗体、斜体)。 |
height | 用于此布局的元素的固定高度。 |
justifyContent | 此容器主轴上的子级的对齐方式。 |
marginBottom | 在布局阶段为此边距的下边缘保留的空间。 |
marginLeft | 在布局阶段为此边距的左边缘保留的空间。 |
marginRight | 在布局阶段为此边距的右边缘保留的空间。 |
marginTop | 在布局阶段为此边距的上边缘保留的空间。 |
maxHeight | 当元素为灵活元素或测量自己的大小时,元素的最大高度。 |
maxWidth | 当元素为灵活元素或测量自己的大小时,元素的最大宽度。 |
minHeight | 当元素为灵活元素或测量自己的大小时,元素的最小高度。 |
minWidth | 当元素为灵活元素或测量自己的大小时,元素的最小高度。 |
paddingBottom | 在布局阶段为此填充的下边缘保留的空间。 |
paddingLeft | 在布局阶段为此填充的左边缘保留的空间。 |
paddingRight | 在布局阶段为此填充的右边缘保留的空间。 |
paddingTop | 在布局阶段为此填充的上边缘保留的空间。 |
positionBottom | 布局期间该元素的框下方的距离。 |
positionLeft | 布局期间该元素的框左侧的距离。 |
positionRight | 布局期间该元素的框右侧的距离。 |
positionTop | 布局期间该元素的框上方的距离。 |
positionType | 元素在其父容器中的放置方式。 |
sliceBottom | 绘制元素背景图像时 9 切片元素的下边缘大小。 |
sliceLeft | 绘制元素背景图像时 9 切片元素的左边缘大小。 |
sliceRight | 绘制元素背景图像时 9 切片元素的右边缘大小。 |
sliceTop | 绘制元素背景图像时 9 切片元素的上边缘大小。 |
textClipping | 当文本不适合此元素的框时进行裁剪。 |
unityTextAlign | 元素框中的水平和垂直文本对齐方式。 |
visibility | 指定元素是否可见。 |
width | 用于此布局的元素的固定高度。 |
wordWrap | 当没有足够的可用空间来绘制元素文本时,自动换行文字。 |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.