视图内部的xcode UITextfield无法编辑

时间:2019-07-10 03:17:15

标签: xcode uitextfield uistackview

我在stackview中添加了一些文本字段,并且在stackview下添加了2views,以便可以创建新列。在该视图内,我放置了textfileds。现在,当我运行它时,Tje文本文件不可编辑。我尝试在stackview外部添加一个新的文本字段,并且效果很好。

您能帮我吗?我通过将文本字段拖到我的contoller中来添加文本字段,因此不涉及任何代码。

<stackView contentMode="scaleToFill" distribution="fillEqually" alignment="top" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="7mt-mS-PCA" userLabel="Add Project">
    <rect key="frame" x="40" y="110" width="1286" height="289"/>
    <subviews>
        <view contentMode="scaleToFill" semanticContentAttribute="playback" translatesAutoresizingMaskIntoConstraints="NO" id="VRJ-lA-xQb">
            <rect key="frame" x="0.0" y="0.0" width="633" height="289"/>
            <subviews>
                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Orderer" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Upf-s1-e9P">
                    <rect key="frame" x="10" y="10" width="47" height="16"/>
                    <fontDescription key="fontDescription" type="system" pointSize="13"/>
                    <color key="textColor" white="0.33333333329999998" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                    <nil key="highlightedColor"/>
                </label>
                <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="jg6-wU-2yV">
                    <rect key="frame" x="10" y="36" width="613" height="30"/>
                    <nil key="textColor"/>
                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
                    <textInputTraits key="textInputTraits"/>
                    <connections>
                        <action selector="OrdererInput:" destination="VWK-Bs-FSH" eventType="editingDidEnd" id="GhB-dm-tKQ"/>
                    </connections>
                </textField>
                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Constuction Area" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Naf-MF-mdY">
                    <rect key="frame" x="10" y="76" width="105" height="16"/>
                    <fontDescription key="fontDescription" type="system" pointSize="13"/>
                    <color key="textColor" white="0.33333333329999998" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                    <nil key="highlightedColor"/>
                </label>
                <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="j44-Dv-X7S">
                    <rect key="frame" x="10" y="102" width="613" height="30"/>
                    <nil key="textColor"/>
                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
                    <textInputTraits key="textInputTraits"/>
                </textField>

这是代码的一部分。

0 个答案:

没有答案