xamarin 横向模式下iOS闪屏未将徽标居中

cnjp1d6j  于 2022-12-07  发布在  iOS
关注(0)|答案(1)|浏览(131)

在Mac上,我使用Xcode在示例项目中设计了屏幕,并将结果复制到VS 2022的闪屏中(Windows)。在Xcode中运行时,代码按预期工作。但是,在VS 2022中运行时,屏幕在纵向模式下显示正确,而在横向模式下显示不正确。这似乎是视图没有意识到设备处于横向模式。如果比较图像,你会看到这个图标是以横向放置的,就像它是以纵向放置的一样。2参阅复合。
我也尝试过对X和Y的超级视图进行约束,但没有成功。
那么,为什么它能在Mac/Xcode上运行,而不能在Windows/VS 2022/Xamarin上运行呢?

<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
    <device id="retina6_1" orientation="landscape" appearance="light"/>
    <dependencies>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
        <capability name="System colors in document resources" minToolsVersion="11.0"/>
        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
    </dependencies>
    <scenes>
        <!--View Controller-->
        <scene sceneID="tne-QT-ifu">
            <objects>
                <viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
                    <view key="view" contentMode="scaleToFill" id="zO9-mi-WmR">
                        <rect key="frame" x="0.0" y="0.0" width="896" height="414"/>
                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                        <subviews>
                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="square.and.arrow.down.on.square.fill" catalog="system" translatesAutoresizingMaskIntoConstraints="NO" id="i2f-xz-yXe">
                                <rect key="frame" x="385.5" y="132.5" width="125" height="129"/>
                                <constraints>
                                    <constraint firstAttribute="width" constant="125" id="iSs-Y6-u1b"/>
                                    <constraint firstAttribute="height" constant="125" id="knT-iP-1d2"/>
                                </constraints>
                            </imageView>
                        </subviews>
                        <viewLayoutGuide key="safeArea" id="9TD-vu-rqU"/>
                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                        <constraints>
                            <constraint firstItem="i2f-xz-yXe" firstAttribute="centerY" secondItem="9TD-vu-rqU" secondAttribute="centerY" id="TIc-QI-zib"/>
                            <constraint firstItem="i2f-xz-yXe" firstAttribute="centerX" secondItem="9TD-vu-rqU" secondAttribute="centerX" id="cVF-vS-Ss8"/>
                        </constraints>
                    </view>
                </viewController>
                <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
            </objects>
            <point key="canvasLocation" x="131.25" y="95.652173913043484"/>
        </scene>
    </scenes>
    <resources>
        <image name="square.and.arrow.down.on.square.fill" catalog="system" width="122" height="128"/>
        <systemColor name="systemBackgroundColor">
            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
        </systemColor>
    </resources>
</document>

portraitlandscapecomposite

qacovj5a

qacovj5a1#

不要相信模拟器,使用实际设备。

相关问题