Xamarin.ios 更改Xamarin窗体应用程序上的飞溅图像

Xamarin.ios 更改Xamarin窗体应用程序上的飞溅图像,xamarin.ios,xamarin.forms,Xamarin.ios,Xamarin.forms,我有一个应用程序是在Visual Studio 2017中使用Xamarin表单模板构建的。它工作得很好,但我想更改启动屏幕上的图像 我有一个高分辨率的图像,想要适合大小,但它太大了,当ios应用程序加载时,你只能看到部分图像 下面是代码,我在LaunchScreen.Storyboard xamarin.ios项目中将图像名称更改为TEST1.png <?xml version="1.0" encoding="UTF-8" standalone="no"?> <documen

我有一个应用程序是在Visual Studio 2017中使用Xamarin表单模板构建的。它工作得很好,但我想更改启动屏幕上的图像

我有一个高分辨率的图像,想要适合大小,但它太大了,当ios应用程序加载时,你只能看到部分图像

下面是代码,我在LaunchScreen.Storyboard xamarin.ios项目中将图像名称更改为TEST1.png

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="X5k-f2-b5h">
<dependencies>
    <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
</dependencies>
<scenes>
    <!--View Controller-->
    <scene sceneID="gAE-YM-kbH">
        <objects>
            <viewController id="X5k-f2-b5h" sceneMemberID="viewController">
                <layoutGuides>
                    <viewControllerLayoutGuide type="top" id="Y8P-hJ-Z43"/>
                    <viewControllerLayoutGuide type="bottom" id="9ZL-r4-8FZ"/>
                </layoutGuides>
                <view key="view" contentMode="scaleToFill" id="yd7-JS-zBw">
                    <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                    <subviews>
                        <imageView userInteractionEnabled="NO" contentMode="scaleToFill" misplaced="YES" image="test1.png" translatesAutoresizingMaskIntoConstraints="NO" id="23">
                            <rect key="frame" x="270" y="270" width="60" height="60"/>
                            <rect key="contentStretch" x="0.0" y="0.0" width="0.0" height="0.0"/>
                        </imageView>
                    </subviews>
                    <color key="backgroundColor" red="0.20392156862745098" green="0.59607843137254901" blue="0.85882352941176465" alpha="1" colorSpace="calibratedRGB"/>
                    <constraints>
                        <constraint firstItem="23" firstAttribute="centerY" secondItem="yd7-JS-zBw" secondAttribute="centerY" priority="1" id="39"/>
                        <constraint firstItem="23" firstAttribute="centerX" secondItem="yd7-JS-zBw" secondAttribute="centerX" priority="1" id="41"/>
                    </constraints>
                </view>
            </viewController>
            <placeholder placeholderIdentifier="IBFirstResponder" id="XAI-xm-WK6" userLabel="First Responder" sceneMemberID="firstResponder"/>
        </objects>
        <point key="canvasLocation" x="349" y="339"/>
    </scene>
</scenes>
<resources>
    <image name="test1.png" width="180" height="180"/>
</resources>

有没有什么方法可以在不改变实际图像本身的情况下调整图像的大小


谢谢

您已将图像的
ContentMode
设置为“
scaleToFill
”。这将使您的图像缩放,使其超出目标区域,直到最小的一面适合齐平

将该图像的
ContentMode
更改为“
scalespectfit
”,然后查看它是否适合您

这些链接有助于详细了解ContentMode:


您已将图像的
内容模式设置为“
缩放填充
”。这将使您的图像缩放,使其超出目标区域,直到最小的一面适合齐平

将该图像的
ContentMode
更改为“
scalespectfit
”,然后查看它是否适合您

这些链接有助于详细了解ContentMode:


跟随。它显示了所有必需的步骤。图像是否显示在屏幕外?你能提供你的启动屏幕截图吗?谢谢大家,这些指南非常有用。它显示了所有必需的步骤。图像是否显示在屏幕外?你能提供你的闪屏截图吗?谢谢大家,这些指南非常有用。非常感谢。有什么地方可以找到关于这个的文档吗?只是为了让我能看到ContentMode等的所有配置?我用添加的链接编辑了我的答案。效果很好,谢谢。有什么地方可以找到关于这个的文档吗?只是为了能看到ContentMode等的所有配置?我用添加的链接编辑了我的答案。