情节提要冲突后的 XML 标记不匹配 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 内容中,例如

头<<<<<<<</p> ========

==

和>>>>>>>

我删除了这些行,并留下了一个错误,说:

"Opening and ending tag mismatch : button line 1251 and subviews"

第 1251 行是我在这里发布的第一行,以按钮隐藏 = "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>"." 

如何修复此错误?

你有"两个"按钮,这就是冲突。您需要删除前两行或删除下两行(第 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>

最新更新