WKInterfacePicker 的动态布局 - Swift - Watch App
Dynamic layout for WKInterfacePicker - Swift - Watch App
我正在创建一个手表应用程序,但我的选择器有问题。
我想要一些像这样水平并排的拾取器:
<!--Page1-->
<scene sceneID="db6-OT-aHK">
<objects>
<controller identifier="Page1" id="U48-q0-PUn" customClass="Page1" customModule="swiftTest_WatchKit_Extension">
<items>
<group width="1" alignment="center" verticalAlignment="center" id="tfC-gp-OjA">
<items>
<picker width="0.33000000000000002" height="100" alignment="center" verticalAlignment="center" id="5k4-Oj-Imh"/>
<picker width="0.33000000000000002" height="100" alignment="center" verticalAlignment="center" id="CWU-iM-QA5"/>
<picker width="0.33000000000000002" height="100" alignment="center" verticalAlignment="center" id="7EB-A5-pKO"/>
</items>
</group>
<group width="1" alignment="left" verticalAlignment="bottom" id="nmP-yl-udb">
<items>
<button width="1" alignment="left" title="Button" id="rSf-z8-JuU"/>
</items>
</group>
</items>
<connections>
<outlet property="goButton" destination="rSf-z8-JuU" id="FMh-MS-VME"/>
<outlet property="picker1" destination="5k4-Oj-Imh" id="Y6q-wM-MPf"/>
<outlet property="picker2" destination="CWU-iM-QA5" id="X2S-hS-XfV"/>
<outlet property="picker3" destination="7EB-A5-pKO" id="V3z-ek-cGw"/>
</connections>
</controller>
</objects>
<point key="canvasLocation" x="463" y="61"/>
</scene>
但是,我的 WKPickerItem 大小不同。使用我固定每个选择器大小的方法,我有大白 space 用于短 WKPickerItem 和其他一些 WKPickerItem 因为它们太长而被切割..
是否可以为这些选择器设置可变大小?
我可以使用 setWidth/Height 动态调整选择器的大小,但无法自动调整选择器的大小。
我认为采摘者不会在手表中这样做
我正在创建一个手表应用程序,但我的选择器有问题。
我想要一些像这样水平并排的拾取器:
<!--Page1-->
<scene sceneID="db6-OT-aHK">
<objects>
<controller identifier="Page1" id="U48-q0-PUn" customClass="Page1" customModule="swiftTest_WatchKit_Extension">
<items>
<group width="1" alignment="center" verticalAlignment="center" id="tfC-gp-OjA">
<items>
<picker width="0.33000000000000002" height="100" alignment="center" verticalAlignment="center" id="5k4-Oj-Imh"/>
<picker width="0.33000000000000002" height="100" alignment="center" verticalAlignment="center" id="CWU-iM-QA5"/>
<picker width="0.33000000000000002" height="100" alignment="center" verticalAlignment="center" id="7EB-A5-pKO"/>
</items>
</group>
<group width="1" alignment="left" verticalAlignment="bottom" id="nmP-yl-udb">
<items>
<button width="1" alignment="left" title="Button" id="rSf-z8-JuU"/>
</items>
</group>
</items>
<connections>
<outlet property="goButton" destination="rSf-z8-JuU" id="FMh-MS-VME"/>
<outlet property="picker1" destination="5k4-Oj-Imh" id="Y6q-wM-MPf"/>
<outlet property="picker2" destination="CWU-iM-QA5" id="X2S-hS-XfV"/>
<outlet property="picker3" destination="7EB-A5-pKO" id="V3z-ek-cGw"/>
</connections>
</controller>
</objects>
<point key="canvasLocation" x="463" y="61"/>
</scene>
但是,我的 WKPickerItem 大小不同。使用我固定每个选择器大小的方法,我有大白 space 用于短 WKPickerItem 和其他一些 WKPickerItem 因为它们太长而被切割..
是否可以为这些选择器设置可变大小?
我可以使用 setWidth/Height 动态调整选择器的大小,但无法自动调整选择器的大小。
我认为采摘者不会在手表中这样做