UIImageView在Xamarin

时间:2018-08-17 13:03:05

标签: c# xamarin xamarin.forms xamarin.ios uiimageview

我正在开发Xamarin Forms应用程序,必须更改LaunchScreen.storyboard文件。 我添加了ImageViewer并选择了一个图像,但该图像未加载到情节提要中。

image属性下拉列表保持空白。

有人遇到过这样的问题吗?

2 个答案:

答案 0 :(得分:0)

自从我将VS更新到最新版本(15.8.1)以来,我遇到了同样的问题 它在资源文件夹中创建图像。我现在的解决方法是设置整个图像,然后关闭编辑器,然后将image =“ file.png”手动添加到imageView的属性中。 超级愚蠢,但有效...

答案 1 :(得分:0)

代码如下

 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="280">
        <dependencies>
            <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
            <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
        </dependencies>
        <scenes>
            <!--View Controller-->
            <scene sceneID="279">
                <objects>
                    <viewController id="280" sceneMemberID="viewController">
                        <layoutGuides>
                            <viewControllerLayoutGuide type="top" id="277"/>
                            <viewControllerLayoutGuide type="bottom" id="278"/>
                        </layoutGuides>
                        <view key="view" contentMode="scaleToFill" id="281">
                            <rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                            <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                            <subviews>
                                <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="284" translatesAutoresizingMaskIntoConstraints="NO" fixedFrame="YES">
                                    <rect key="frame" x="87" y="304" width="240" height="128"/>
                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                </imageView>
                            </subviews>
                        </view>
                    </viewController>
                    <placeholder placeholderIdentifier="IBFirstResponder" id="282" userLabel="First Responder" sceneMemberID="firstResponder"/>
                </objects>
                <point key="canvasLocation" x="271" y="359"/>
            </scene>
        </scenes>
        <color key="tintColor" colorSpace="calibratedWhite" white="1" alpha="1"/>
    </document>