Skip to content

UIView

所有 UI 控件的基类。通过 new UIView(frame)initWithFrame(frame) 创建,frame 为 { x, y, width, height }。可将插件面板添加到 StudyController.view

属性类型说明
frameCGRect位置与大小。
boundsCGRect内部坐标系。
backgroundColorUIColor背景色。
hiddenboolean是否隐藏。
layerCALayer图层,可设置 cornerRadius、borderWidth、borderColor 等。
subviewsNSArray子视图数组。
superviewUIView父视图。
windowUIWindow所在窗口。
tagnumber标签。
alphanumber透明度。
autoresizingMasknumber自动调整掩码(如 1<<0 右边缘)。
方法说明
addSubview(view)添加子视图。
removeFromSuperview()从父视图移除。
insertSubviewBelowSubview(view, sibling)插入到某子视图下方。
insertSubviewAboveSubview(view, sibling)插入到某子视图上方。
viewWithTag(tag)按 tag 查找子视图。