簡體   English   中英

適用於iOS的Xamarin表單:初始屏幕顯示藍色邊框

[英]Xamarin Forms for iOS: Splash Screen shows blue border

我有一個iOS啟動畫面,它周圍始終顯示藍色邊框。 有人告訴我,它與具有LaunchStoryboard值的info.plist( https://forums.xamarin.com/discussion/34081/splash-screen-on-an-xamarin-forms-app-ios )有關,但是我的info.plist上沒有這樣的密鑰。 有任何想法嗎?

這是我的info.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>UIDeviceFamily</key>
    <array>
        <integer>1</integer>
        <integer>2</integer>
    </array>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
    <key>MinimumOSVersion</key>
    <string>8.0</string>
    <key>CFBundleDisplayName</key>
    <string>MDLDemo</string>
    <key>CFBundleIdentifier</key>
    <string>com.demo.mdl.hcm</string>
    <key>CFBundleVersion</key>
    <string>1.0</string>
    <key>CFBundleIconFiles</key>
    <array>
        <string>icon-60@2x.png</string>
    </array>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>CFBundleShortVersionString</key>
    <string>0.0.1</string>
    <key>UIPrerenderedIcon</key>
    <false/>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
</dict>
</plist>

這是我的LaunchScreen.storyboard文件

<?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="scaleAspectFit" misplaced="YES" image="Default-568h.png" translatesAutoresizingMaskIntoConstraints="NO" id="23">
                                <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
                                <rect key="contentStretch" x="0.0" y="0.0" width="0.0" height="0.0"/>
                                <variation key="heightClass=regular-widthClass=compact" misplaced="YES">
                                    <rect key="frame" x="-8" y="-79" width="390" height="825"/>
                                </variation>
                                <variation key="widthClass=compact" misplaced="YES">
                                    <rect key="frame" x="-100" y="0.0" width="600" height="600"/>
                                </variation>
                                <variation key="widthClass=regular" misplaced="YES">
                                    <rect key="frame" x="-123" y="-4" width="625" height="678"/>
                                </variation>
                            </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="Icon-60.png" width="120" height="120"/>
        <image name="Default-568h.png" width="640" height="1136"/>
        <image name="Default-Portrait.png" width="768" height="1004"/>
        <image name="Default.png" width="320" height="480"/>
        <image name="Icon-Small-40.png" width="120" height="120"/>
        <image name="Icon-Small.png" width="87" height="87"/>
        <image name="Untitled 320 480.png" width="320" height="480"/>
        <image name="Untitled 640 1136.png" width="640" height="1136"/>
        <image name="background.png" width="541" height="613"/>
        <image name="background_bottom.png" width="539" height="499"/>
        <image name="background_top.png" width="539" height="12"/>
        <image name="email.png" width="42" height="43"/>
        <image name="FirstTimeCheckIn.png" width="601" height="789"/>
        <image name="forgot_password.png" width="46" height="37"/>
        <image name="icon-60.png" width="120" height="120"/>
        <image name="icon 320 480.png" width="320" height="480"/>
        <image name="icon 640 1136.png" width="640" height="1136"/>
        <image name="icon 640 960.png" width="640" height="960"/>
        <image name="menu.png" width="33" height="54"/>
        <image name="password.png" width="39" height="37"/>
        <image name="Register.png" width="809" height="1000"/>
        <image name="remember_me.png" width="50" height="43"/>
        <image name="Assets/FirstTimeCheckIn.png" width="601" height="789"/>
        <image name="Assets/search.png" width="35" height="35"/>
        <image name="Assets/greenMessage.png" width="54" height="51"/>
        <image name="Assets/orangeMessage.png" width="54" height="51"/>
        <image name="Assets/redMessage.png" width="54" height="51"/>
        <image name="Assets/settings.png" width="24" height="24"/>
        <image name="Assets/search2.png" width="24" height="24"/>
        <image name="Assets/icons_white/add.png" width="44" height="44"/>
        <image name="Assets/icons_white/camera.png" width="44" height="44"/>
        <image name="Assets/icons_white/clipboard.png" width="44" height="44"/>
        <image name="Assets/icons_white/confirm.png" width="44" height="44"/>
        <image name="Assets/icons_white/email.png" width="44" height="44"/>
        <image name="Assets/icons_white/enter_password.png" width="44" height="44"/>
        <image name="Assets/icons_white/left_arrow.png" width="44" height="44"/>
        <image name="Assets/icons_white/menu.png" width="44" height="44"/>
        <image name="Assets/icons_white/message.png" width="44" height="44"/>
        <image name="Assets/icons_white/microphone.png" width="44" height="44"/>
        <image name="Assets/icons_white/no.png" width="44" height="44"/>
        <image name="Assets/icons_white/patiente_id.png" width="44" height="44"/>
        <image name="Assets/icons_white/phone_number.png" width="44" height="44"/>
        <image name="Assets/icons_white/right_arrow.png" width="44" height="44"/>
        <image name="Assets/icons_white/search.png" width="44" height="44"/>
        <image name="Assets/icons_white/settings.png" width="44" height="44"/>
        <image name="Assets/icons_white/trash.png" width="44" height="44"/>
        <image name="Assets/icons_white/username.png" width="44" height="44"/>
        <image name="Assets/icons_white/write_msg.png" width="44" height="44"/>
        <image name="Assets/icons_white/write_name.png" width="44" height="44"/>
        <image name="Assets/icons_white/yes.png" width="44" height="44"/>
        <image name="Assets/icons_blue/add.png" width="44" height="44"/>
        <image name="Assets/icons_blue/camera.png" width="44" height="44"/>
        <image name="Assets/icons_blue/clipboard.png" width="44" height="44"/>
        <image name="Assets/icons_blue/confirm.png" width="44" height="44"/>
        <image name="Assets/icons_blue/email.png" width="44" height="44"/>
        <image name="Assets/icons_blue/enter_password.png" width="44" height="44"/>
        <image name="Assets/icons_blue/left_arrow.png" width="44" height="44"/>
        <image name="Assets/icons_blue/menu.png" width="44" height="44"/>
        <image name="Assets/icons_blue/message.png" width="44" height="44"/>
        <image name="Assets/icons_blue/microphone.png" width="44" height="44"/>
        <image name="Assets/icons_blue/no.png" width="44" height="44"/>
        <image name="Assets/icons_blue/patiente_id.png" width="44" height="44"/>
        <image name="Assets/icons_blue/phone_number.png" width="44" height="44"/>
        <image name="Assets/icons_blue/right_arrow.png" width="44" height="44"/>
        <image name="Assets/icons_blue/search.png" width="44" height="44"/>
        <image name="Assets/icons_blue/settings.png" width="44" height="44"/>
        <image name="Assets/icons_blue/trash.png" width="44" height="44"/>
        <image name="Assets/icons_blue/username.png" width="44" height="44"/>
        <image name="Assets/icons_blue/write_msg.png" width="44" height="44"/>
        <image name="Assets/icons_blue/write_name.png" width="44" height="44"/>
        <image name="Assets/icons_blue/yes.png" width="44" height="44"/>
        <image name="Assets/icons_white/white_arrow.png" width="8" height="12"/>
        <image name="Assets/icons_white/white_arrow2.png" width="8" height="12"/>
        <image name="Assets/icons_white/white_balloon.png" width="200" height="40"/>
        <image name="Assets/icons_blue/blue_arrow.png" width="8" height="12"/>
        <image name="Assets/icons_blue/blue_arrow2.png" width="8" height="12"/>
        <image name="Assets/icons_blue/blue_balloon.png" width="200" height="40"/>
        <image name="Assets/white_balloon-03.png" width="214" height="60"/>
        <image name="Assets/blue_ballon-03.png" width="214" height="60"/>
        <image name="Assets/girl60x60.png" width="60" height="60"/>
        <image name="Assets/boy60x60.png" width="60" height="60"/>
        <image name="Assets/boy40x40.png" width="40" height="40"/>
        <image name="Assets/girl40x40.png" width="40" height="40"/>
        <image name="Assets/logo_transp60x60.png" width="60" height="60"/>
        <image name="Assets/logo_transp240x240.png" width="240" height="240"/>
        <image name="Assets/logo240x240.png" width="240" height="240"/>
        <image name="Assets/logo60x60.png" width="60" height="60"/>
        <image name="Assets/yes88x88.png" width="88" height="88"/>
        <image name="Assets/no88x88.png" width="88" height="88"/>
        <image name="Assets/splash_texture.png" width="750" height="1334"/>
        <image name="Assets/bg.png" width="750" height="1334"/>
        <image name="Assets/back_arrow.png" width="44" height="44"/>
        <image name="Assets/background.png" width="541" height="613"/>
        <image name="Assets/menu.png" width="23" height="21"/>
        <image name="Assets/email.png" width="42" height="43"/>
        <image name="Assets/forgot_password.png" width="46" height="37"/>
        <image name="Assets/password.png" width="39" height="37"/>
        <image name="Assets/remember_me.png" width="50" height="43"/>
        <image name="Assets/Register.png" width="809" height="1000"/>
        <image name="Assets/persona.png" width="79" height="70"/>
        <image name="Assets/personb.png" width="70" height="67"/>
        <image name="Assets/avatar-man.png" width="318" height="318"/>
        <image name="Assets/icon-plus.png" width="300" height="300"/>
        <image name="Assets/messaging-send.png" width="54" height="57"/>
        <image name="Assets/messsaging-camera.png" width="59" height="50"/>
        <image name="splashscreen-small.png" width="320" height="480"/>
        <image name="Default-667h.png" width="640" height="1136"/>
    </resources>
    <simulatedMetricsContainer key="defaultSimulatedMetrics">
        <simulatedScreenMetrics key="destination" type="retina47"/>
    </simulatedMetricsContainer>
</document>

我修好了它。 我按照屏幕上的所有說明使用了Storyboard教程( https://developer.xamarin.com/guides/ios/application_fundamentals/working_with_images/launch-screens/#storyboard )上的Xamarin.iOS啟動屏幕教程。 但是,當我到達:

  1. 滾動到編輯器的“通用啟動圖像”部分,打開“啟動屏幕”下拉菜單,然后選擇剛剛在上面創建的情節提要的名稱:

我的自定義情節提要沒有出現在“啟動屏幕”下拉菜單上。 我最終選擇了默認源(解決方案中的“ LaunchImage”),然后在啟動屏幕上手動鍵入了故事板的文件名(不帶.storyboard擴展名)。 之后,一切正常。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM