XML 故事板冲突后标签不匹配 iOS
XML tag mismatch after storyboard conflict iOS
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qxz-gx-8Ik">
<rect key="frame" x="275" y="5" width="30" height="33"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qxz-gx-8Ik">
<rect key="frame" x="282" y="2" width="30" height="33"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<state key="normal" title="Edit">
<color key="titleColor" red="1" green="0.59999999999999998" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="updateAction:" destination="akK-dA-Jb1" eventType="touchUpInside" id="UBU-1j-Tmg"/>
</connections>
</button>
</subviews>
我有故事板合并冲突,在选择保留远程分支的设置后,一些 gitmerge 文本被放入我的故事板的 XML 内容中,例如
头<<<<<<<
==========
和>>>>>>>
我删除了这些行,但留下一条错误消息:
"Opening and ending tag mismatch : button line 1251 and subviews"
第 1251 行是我在这里发布的第一行以 button hidden = "YES"
开头的行
当我将我的 XML 放入 https://www.freeformatter.com/xml-formatter.html 等格式化程序时,它说:`
"Unable to parse any XML input. Error on line 13: The element type "button" must be terminated by the matching end-tag "</button>"."
我该如何解决这个错误?
你有"two"个按钮,就是冲突了。您需要删除前两行或删除下一行(第 3 和 4 行)。
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qxz-gx-8Ik">
<rect key="frame" x="282" y="2" width="30" height="33"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<state key="normal" title="Edit">
<color key="titleColor" red="1" green="0.59999999999999998" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="updateAction:" destination="akK-dA-Jb1" eventType="touchUpInside" id="UBU-1j-Tmg"/>
</connections>
</button>
</subviews>
或:
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qxz-gx-8Ik">
<rect key="frame" x="275" y="5" width="30" height="33"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<state key="normal" title="Edit">
<color key="titleColor" red="1" green="0.59999999999999998" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="updateAction:" destination="akK-dA-Jb1" eventType="touchUpInside" id="UBU-1j-Tmg"/>
</connections>
</button>
</subviews>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qxz-gx-8Ik">
<rect key="frame" x="275" y="5" width="30" height="33"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qxz-gx-8Ik">
<rect key="frame" x="282" y="2" width="30" height="33"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<state key="normal" title="Edit">
<color key="titleColor" red="1" green="0.59999999999999998" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="updateAction:" destination="akK-dA-Jb1" eventType="touchUpInside" id="UBU-1j-Tmg"/>
</connections>
</button>
</subviews>
我有故事板合并冲突,在选择保留远程分支的设置后,一些 gitmerge 文本被放入我的故事板的 XML 内容中,例如
头<<<<<<<
==========
和>>>>>>>
我删除了这些行,但留下一条错误消息:
"Opening and ending tag mismatch : button line 1251 and subviews"
第 1251 行是我在这里发布的第一行以 button hidden = "YES"
开头的行当我将我的 XML 放入 https://www.freeformatter.com/xml-formatter.html 等格式化程序时,它说:`
"Unable to parse any XML input. Error on line 13: The element type "button" must be terminated by the matching end-tag "</button>"."
我该如何解决这个错误?
你有"two"个按钮,就是冲突了。您需要删除前两行或删除下一行(第 3 和 4 行)。
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qxz-gx-8Ik">
<rect key="frame" x="282" y="2" width="30" height="33"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<state key="normal" title="Edit">
<color key="titleColor" red="1" green="0.59999999999999998" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="updateAction:" destination="akK-dA-Jb1" eventType="touchUpInside" id="UBU-1j-Tmg"/>
</connections>
</button>
</subviews>
或:
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qxz-gx-8Ik">
<rect key="frame" x="275" y="5" width="30" height="33"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<state key="normal" title="Edit">
<color key="titleColor" red="1" green="0.59999999999999998" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</state>
<connections>
<action selector="updateAction:" destination="akK-dA-Jb1" eventType="touchUpInside" id="UBU-1j-Tmg"/>
</connections>
</button>
</subviews>