2017-02-19 1 views
1

У меня есть этот Main.storyboard, но когда я переместить <rect> из x="20" y="28" width="96" height="128" в <rect key="frame" x="416" y="496" width="96" height="96"/>iPhone 7 - xcode показывает правильно, но когда я выполняю на устройстве элемент невидим?

Тогда на реальном 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. Похоже, вы используете маски автоматического изменения размера старого стиля, но затем отключили их преобразование в ограничения. Я бы посоветовал узнать, как создавать ограничения автоматического макета в построителе интерфейса.

Смежные вопросы