首页 > 解决方案 > 截断 UITableViewCell iOS 13 的底部

问题描述

UITableView高度有问题——底部UILabel在iOS13.8被剪掉了 在此处输入图像描述

我已经设置了如下的行高,但它不起作用

WindowsTableView.RowHeight = UITableView.AutomaticDimension;
 WindowsTableView.EstimatedRowHeight = 128;

可能有什么问题?我试图删除底部约束,但它不起作用


我的 .xib 文件的代码:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
    <dependencies>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
        <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
    </dependencies>
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
        <tableViewCell contentMode="TopLeft" layoutMarginsFollowReadableWidth="YES" selectionStyle="default" indentationWidth="10" rowHeight="168" id="cxk-wN-pdQ" customClass="ConfirmWindowCell">
            <rect key="frame" x="0.0" y="0.0" width="320" height="168"/>
            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="cxk-wN-pdQ" id="YTl-1W-gDM">
                <rect key="frame" x="0.0" y="0.0" width="320" height="167"/>
                <autoresizingMask key="autoresizingMask"/>
                <subviews>
                    <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" id="2303" translatesAutoresizingMaskIntoConstraints="NO" spacing="8">
                        <rect key="frame" x="20" y="20" width="280" height="127.5"/>
                        <subviews>
                            <stackView opaque="NO" contentMode="scaleToFill" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="DlC-6u-AXD" ambiguous="YES">
                                <rect key="frame" x="0.0" y="0.0" width="280" height="30.5"/>
                                <subviews>
                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="900-rg-zgb" ambiguous="YES">
                                        <rect key="frame" x="0.0" y="0.0" width="42" height="30.5"/>
                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                        <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                        <nil key="highlightedColor"/>
                                    </label>
                                    <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Номер машины" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="2" ambiguous="YES">
                                        <rect key="frame" x="52" y="0.0" width="228" height="30.5"/>
                                        <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                        <textInputTraits key="textInputTraits"/>
                                    </textField>
                                </subviews>
                            </stackView>
                            <stackView contentMode="scaleToFill" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="1060" opaque="NO" ambiguous="YES">
                                <rect key="frame" x="0.0" y="38.5" width="280" height="34"/>
                                <subviews>
                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="+7" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1079" ambiguous="YES">
                                        <rect key="frame" x="0.0" y="0.0" width="20" height="34"/>
                                        <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                        <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                        <nil key="highlightedColor"/>
                                    </label>
                                    <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Телефон водителя" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="1062" ambiguous="YES">
                                        <rect key="frame" x="30" y="0.0" width="250" height="34"/>
                                        <textInputTraits key="textInputTraits"/>
                                        <fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="14"/>
                                    </textField>
                                </subviews>
                            </stackView>
                            <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Не указан номер, хотя мог бы быть и указан вообще-то. Введите данные ещё раз." textAlignment="center" lineBreakMode="wordWrap" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="DKf-Sf-qvd" numberOfLines="0">
                                <rect key="frame" x="0.0" y="80.5" width="280" height="47"/>
                                <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
                                <fontDescription key="fontDescription" type="system" pointSize="13"/>
                                <nil key="highlightedColor"/>
                            </label>
                        </subviews>
                    </stackView>
                </subviews>
                <constraints>
                    <constraint id="2304" firstItem="2303" firstAttribute="top" secondItem="YTl-1W-gDM" secondAttribute="top" constant="20" symbolic="YES"/>
                    <constraint id="2305" firstItem="2303" firstAttribute="leading" secondItem="YTl-1W-gDM" secondAttribute="leading" constant="20" symbolic="YES"/>
                    <constraint id="2307" firstAttribute="trailing" secondItem="2303" secondAttribute="trailing" constant="20" symbolic="YES"/>
                    <constraint id="3505" firstAttribute="bottom" secondItem="2303" secondAttribute="bottom" constant="20"/>
                </constraints>
            </tableViewCellContentView>
            <connections>
                <outlet property="CellView" destination="YTl-1W-gDM" id="name-outlet-YTl-1W-gDM"/>
                <outlet property="ValidationLabel" destination="DKf-Sf-qvd" id="name-outlet-DKf-Sf-qvd"/>
                <outlet property="DriverPhoneText" destination="1062" id="name-outlet-1062"/>
                <outlet property="DriverPhoneStackView" destination="1060" id="name-outlet-1060"/>
                <outlet property="PlateText" destination="2" id="name-outlet-2"/>
                <outlet property="TimeLabel" destination="900-rg-zgb" id="name-outlet-900-rg-zgb"/>
            </connections>
            <point key="canvasLocation" x="499" y="445"/>
        </tableViewCell>
    </objects>
</document>

标签: iosxamarin.iosios13

解决方案


推荐阅读