[英]How to embed in view (i.e. group UI elements) programmatically
In X-Code, I can do "Editor -> Embed In -> View/Scrollview" to group UI widgets together. 在X代码中,我可以执行“编辑器->嵌入->视图/滚动视图”以将UI小部件组合在一起。 How is that done programmatically?
如何以编程方式完成?
Is it same as doing addSubView to a parent view? 与对父视图执行addSubView一样吗?
It is the same . 是一样的 。
For example to add a UILabel
to a UIScrollView
, simply type myScrollView.addSubview(myLabel)
and your label is added to the ScrollView
. 例如,要将
UILabel
添加到UIScrollView
,只需键入myScrollView.addSubview(myLabel)
然后将标签添加到ScrollView
。
Hope that helps :) 希望有帮助:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.