2017-12-13 11 views
0

私は困惑しています。プロジェクトを作成すると、LaunchScreen.xibには、Visual StudioでiOSプロジェクトを作成したときに取得する既定のコンテンツが表示されていました。問題ない。私は、xibを編集し、ラベルと画像を追加し、今は表示されないことにしました。アプリケーションの起動時に黒い画面が表示されます。だから私はxibに追加したものすべてを削除して、元の起動画面に戻ってくると思った。いいえ、まだ黒がかかっています。私はウェブ全体を検索し、見つけることができるすべての "修正"を試みました。まだ黒。 Storyboardを使用して別のxib(MyLaunchScreen.xib)を作成しようとしても、まだ黒がロードされます。オリジナルのxibに触れるとすぐに、手のひらで地獄に行きました。これがどのように解決できるかについてご意見がありましたら、感謝します。ありがとう。Visual Studio 2017をXamarinで使用する - iOS起動画面が黒色/空白

答えて

0

に新しいファイルを選択して私がのために働いて解決策を見つけました私、最初の少しの背景:私の問題に特有のWeb上で見つけられる唯一の答えは、Visual Studio 2015です。答えは、リソースを右クリックし、リソースに「LaunchScreen.xib」を追加することで自分の起動画面を作成すると言いましたフォルダには、2017年にそのようなオプションはありませんでした。明らかに、Visual Studioは少し変わっていますので、Resourcesフォルダを右クリックして新しいアイテムを追加すると、.xibである "View"を選択できます。私はそれをして、私が探していたものを手に入れ、私が望んでいたラベルとイメージビューを追加しました。私はこの問題がデフォルトのLaunchScreen.xibに組み込まれている制約に起因していると確信しています.Xamarin for Visual Studio 2017で使用されている制約システムは、私が作成したLaunchScreen.xibに制約がないようにbejesusを混乱させます。 Apple Storeでアプリをリリースしようとすると、後でこの問題が起こるかもしれませんが、後でそれを扱います。以下はLaunchScreen.xibです。これは、XMLファイルでは動作しませんが、それ以外の場合は動作しません。おそらく誰かが私に拘束力のあることを説明することができます。今、うん。

LaunchScreen.xib(私は正確に右のそれを取得しない場合は、フォーマットを言い訳):

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
    <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="15G18013" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES"> 
     <dependencies> 
      <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/> 
      <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/> 
      <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"/> 
        <view contentMode="scaleToFill" id="iN0-l3-epB"> 
         <rect key="frame" x="0.0" y="0.0" width="480" height="480"/> 
         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> 
        <subviews> 
         <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2017 C &amp; G Associates, Inc." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye"> 
          <rect key="frame" x="20" y="439" width="440" height="21"/> 
          <fontDescription key="fontDescription" type="system" pointSize="17"/> 
          <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> 
          <nil key="highlightedColor"/> 
         </label> 
         <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sample Out" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX" misplaced="YES"> 
          <rect key="frame" x="20" y="36" width="440" height="43"/> 
          <fontDescription key="fontDescription" name="TimesNewRomanPS-BoldItalicMT" family="Times New Roman" pointSize="36"/> 
          <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> 
          <nil key="highlightedColor"/> 
         </label> 
        </subviews> 
        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> 
        <constraints> 
         <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/> 
         <constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/> 
         <constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/> 
         <constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/> 
         <constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/> 
         <constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/> 
        </constraints> 
        <nil key="simulatedStatusBarMetrics"/> 
        <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> 
        <point key="canvasLocation" x="548" y="455"/> 
        <accessibility key="accessibilityConfiguration"> 
         <bool key="isElement" value="YES"/> 
        </accessibility> 
        <connections> 
         <outlet property="lblCopyRight" destination="8ie-xW-0ye" id="name-outlet-8ie-xW-0ye"/> 
        </connections> 
       </view> 
      </objects> 
      <resources> 
       <image name="CarpetSample.png" width="1294" height="861"/> 
      </resources> 
</document> 

MyLaunchScreen.xib(この作品):

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
    <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="15G18013" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" launchScreen="YES"> 
    <device id="ipad9_7" orientation="portrait"> 
     <adaptation id="fullscreen"/> 
    </device> 
    <dependencies> 
     <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/> 
     <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"/> 
     <view contentMode="scaleToFill" id="1"> 
      <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/> 
      <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> 
      <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> 
      <subviews> 
       <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sample Out" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="165" translatesAutoresizingMaskIntoConstraints="NO" fixedFrame="YES"> 
        <rect key="frame" x="0.0" y="29" width="768" height="58"/> 
        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> 
        <fontDescription key="fontDescription" name="TimesNewRomanPS-BoldItalicMT" family="Times New Roman" pointSize="36"/> 
        <nil key="textColor"/> 
        <nil key="highlightedColor"/> 
       </label> 
       <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="268" translatesAutoresizingMaskIntoConstraints="NO" fixedFrame="YES" text="Copyright (c) 2017 C &amp; G Associates, Inc."> 
        <rect key="frame" x="0.0" y="943" width="768" height="45"/> 
        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> 
        <fontDescription key="fontDescription" type="system" pointSize="17"/> 
        <nil key="textColor"/> 
        <nil key="highlightedColor"/> 
       </label> 
       <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="328" translatesAutoresizingMaskIntoConstraints="NO" fixedFrame="YES" image="CarpetSample.png"> 
        <rect key="frame" x="43" y="111" width="685" height="806"/> 
        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> 
       </imageView> 
      </subviews> 
     </view> 
    </objects> 
    <resources> 
     <image name="CarpetSample.png" width="1294" height="861"/> 
    </resources> 
</document> 
0

たぶん、あなたは、元の.xibで壊れたものを作っ

は、以下の手順を試してください:

  1. は、シミュレータでアプリをアンインストールします。

  2. 新しい.Storyboardまたは.Xibファイルを作成し、元の.Xib

  3. を削除info.plist

enter image description here

+0

おかげで、すでにそれを試してみました。どうやら、Visual Studio 2017のXamarinは、 "New Item"をリソースに追加するときに "Launch Screen"オプションがないので、違います。私は新しいxibを追加しようとしましたが、それはすべての境界で奇妙だった。だから私がやったのは、新しいテスト用のiosプロジェクトを作成し、そこに作成されたLaunchScreen.xibファイルを私のプロジェクトにコピーしてくれました。今、私は2つのファイルを比較して、何が違うかを見ています。それは私がやっていることです、私は私の変更がそれが表示されないようにすると思う。制約があると私は信じています。私はすべての投稿を保管しておきます。 –

+0

「新しいアイテム」を「リソース」に追加するときに「起動画面」オプションがないということはどういう意味ですか?あなたのvsはWindowsやMacで動作しますか? –

+0

私はWindows 7上でVisual Studio v15.5.1でXamarinを使用しています。 –

関連する問題