2017-02-19 6 views
1

私はこのMain.storyboardを持っていますが、私は<rect key="frame" x="416" y="496" width="96" height="96"/>iPhone 7 - xcodeが正しく表示されますが、デバイスで実行すると要素が見えなくなりますか?

x="20" y="28" width="96" height="128"から<rect>を移動すると、その後、実際のiPhone 7に私はまったくその要素は表示されません。

なぜそれが失われていますか? <rect>は常に右下に固定されていると言うことができますか?

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc"> 
<dependencies> 
<deployment identifier="iOS"/> 
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/> 
</dependencies> 
<scenes> 
<!--View Controller--> 
<scene sceneID="ufC-wZ-h7g"> 
<objects> 
<viewController id="vXZ-lx-hvc" customClass="ViewController" sceneMemberID="viewController"> 
<layoutGuides> 
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/> 
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/> 
</layoutGuides> 
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS"> 
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/> 
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> 
<subviews> 
<view contentMode="scaleAspectFit" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fIq-yw-hCc" userLabel="Remote View" customClass="RTCEAGLVideoView"> 
<rect key="frame" x="-140" y="-16" width="600" height="600"/> 
<animations/> 
<color key="backgroundColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> 
</view> 
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="oEs-Uu-HsQ" userLabel="Local View"> 
<rect key="frame" x="416" y="496" width="96" height="96" /> 
<animations/> 
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> 
</view> 
</subviews> 
<animations/> 
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> 
</view> 
<connections> 
<outlet property="localView" destination="oEs-Uu-HsQ" id="V9h-Lg-Z2G"/> 
<outlet property="remoteView" destination="fIq-yw-hCc" id="tJt-sU-42X"/> 
</connections> 
</viewController> 
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/> 
</objects> 
</scene> 
</scenes> 
</document> 

ViewController.h:

#import <UIKit/UIKit.h> 

@interface ViewController : UIViewController 

@end 

ViewController.m:

#import "ViewController.h" 
@interface ViewController() <SocketIOSignalingDelegate, VideoViewDelegate> 
@property (strong, nonatomic) IBOutlet VideoView *remoteView; 
@property (strong, nonatomic) IBOutlet UIView *localView; 

@implementation ViewController 

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 
} 

答えて

1

あなたは、自動レイアウトを使用する必要があり、多くのガイドがそこにあります。例えばこれはAppleからのものです。古いスタイルの自動サイズ変更マスクを使用しているように見えますが、これらのマスクを制約に変換することはできません。インターフェースビルダーで自動レイアウト制約を作成する方法を学ぶことをおすすめします。

関連する問題