3

Xcode 4.5 のバグと思われるものに、私はかなり当惑しています。Interface Builder で新しく作成された UIViewController のルート ビューの autoresizingMask プロパティを設定できません。問題を再現する手順は次のとおりです。

  • 新しいストーリーボードを作成する
  • ファイル インスペクタで [自動レイアウトを使用] のチェックを外します
  • デフォルト シーンのルート ビューを選択します
  • サイズインスペクタに移動
  • [自動サイズ設定] ダイアログのスプリングは破線でグレー表示され、クリックできません (ストラットは適切に機能しています)。

既存のビューを削除し、オブジェクト ライブラリから新しいビューをドラッグすると、新しいビューで autosizingMask が有効になります (無効にすることはできません)。

これは、私が取り組んでいる 2 つのプロジェクトで 2 回発生しましたが、新しく作成したプロジェクトでは発生しません。何か不足していますか?この動作を引き起こす原因は何ですか?

これは、テスト ストーリーボードの XML です。最初のViewControllerstoryboardIdentifier="springsWorking"は、元のビューを削除して編集したもので、2番目のものstoryboardIdentifier="default"はデフォルトのものです。

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="2844" systemVersion="12C60" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="KEy-1l-Qqy">
<dependencies>
    <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1930"/>
</dependencies>
<scenes>
    <!--View Controller-->
    <scene sceneID="dwh-DZ-gCp">
        <objects>
            <viewController storyboardIdentifier="springsWorking" id="KEy-1l-Qqy" sceneMemberID="viewController">
                <view key="view" contentMode="scaleToFill" id="ngZ-jh-RR4">
                    <rect key="frame" x="0.0" y="20" width="768" height="1004"/>
                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
                </view>
            </viewController>
            <placeholder placeholderIdentifier="IBFirstResponder" id="jow-h4-M4B" userLabel="First Responder" sceneMemberID="firstResponder"/>
        </objects>
        <point key="canvasLocation" x="-428" y="-327"/>
    </scene>
    <!--View Controller-->
    <scene sceneID="445-Ak-YxL">
        <objects>
            <viewController storyboardIdentifier="default" id="ZA8-km-Ecn" sceneMemberID="viewController">
                <view key="view" contentMode="scaleToFill" id="lRF-Uf-5lh">
                    <rect key="frame" x="0.0" y="20" width="768" height="1004"/>
                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
                </view>
            </viewController>
            <placeholder placeholderIdentifier="IBFirstResponder" id="fZf-TK-JQE" userLabel="First Responder" sceneMemberID="firstResponder"/>
        </objects>
        <point key="canvasLocation" x="760" y="-313"/>
    </scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
    <simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackTranslucent"/>
    <simulatedOrientationMetrics key="orientation"/>
    <simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>

4

1 に答える 1

11

「属性インスペクター」(右側のパネル。アイコンはスライダーのように見えます)で、「シミュレートされたメトリック」の下にある「サイズ」ポップアップを開き、「フリーフォーム」を選択します。これにより、これらのコントロールのロックが解除されます。(それ以外の場合は、サイズが全画面に一致しているので、それが必要だと考えられます。)

于 2013-01-15T01:27:30.890 に答える