【发布时间】:2020-08-06 15:45:54
【问题描述】:
我有一个 viewController xib 文件,我在其中设计了一个具有以下特征的按钮(取自 xib 文件)
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="HKv-Bv-6j3">
<rect key="frame" x="126" y="9" width="250" height="32"/>
<buttonCell key="cell" type="push" title="Disable" bezelStyle="rounded" alignment="center"
borderStyle="border" imageScaling="proportionallyDown" inset="2" id="YYS-ZL-U1e">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
现在我希望以编程方式添加任意数量的类似设计按钮。如何将上面的 XML 转换为 Objective-C 代码。
【问题讨论】:
标签: ios objective-c macos user-interface nsbutton