简体   繁体   English

在iOS中将接口从设备缩放到另一设备时出现问题

[英]Problems with scaling interface from a device to another in iOS

This issue is really frustrating and getting me crazy. 这个问题确实令人沮丧,并使我发疯。

I've read everything about AutoLayout and so on, but it happens all the time. 我已经阅读了有关AutoLayout等的所有内容,但是它一直都在发生。 My interface has a view with an image view as background and a smaller subview on top of it (corresponding to a field in my image). 我的界面有一个以图像视图为背景的视图,在它的顶部有一个较小的子视图(对应于我图像中的一个字段)。 I've tried everything but it looks like the subview does not scale accordingly with my image when switching through devices. 我已经尝试了所有方法,但是在通过设备切换时,子视图似乎无法根据我的图像缩放。 By the way, the IB preview does not show what i real get when running the iOS Simulator, is that normal? 顺便说一句,IB预览无法显示我在运行iOS Simulator时真正得到的东西,这正常吗? Why? 为什么? What do i do wrong? 我做错了什么? I'm not sure what else to try! 我不确定还有什么尝试!

http://i58.tinypic.com/34xqtc6.png http://i58.tinypic.com/34xqtc6.png

EDIT: i cannot post images :( 编辑:我不能发布图像:(

I have setup a githubrepo regarding your case, kindly have a look https://github.com/usamaiqbal83/TestingProject 我已经为您的案例设置了一个githubrepo,请看一下https://github.com/usamaiqbal83/TestingProject

在此处输入图片说明

Constraints for Background Image View: 背景图像视图的约束:

在此处输入图片说明

Constraints for Front View 前视图的约束

在此处输入图片说明

the most important thing to remember is ofcourse the constraint equation 当然要记住的最重要的事情是约束方程

FirstItem.Attribute1 = (SecondItem.Attribute2 * Multiplier) + Constant

Instead of subview use Container View. 代替子视图,使用容器视图。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将相机视频从iOS设备流式传输到另一个iOS设备 - Stream camera video from iOS device to another iOS device 从一台iOS设备到另一台设备的信息交流 - Communicating information from one iOS device to another iOS应用程序的设备目标存在问题 - Problems with device target for iOS app iOS流音频从一个iOS设备到另一个 - iOS Stream Audio from one iOS Device to Another 防止 GMSMarkers 在 iOS 上缩放? - Prevent GMSMarkers from Scaling on iOS? 从另一个Class iOS将数据加载到UITableView时出现问题 - Problems loading Data into UITableView from another Class iOS iOS中的iBeacons-从实际的BLE设备没有回调,但是当另一个iOS设备用作广播者时,didRangeBeacons被调用 - iBeacons in iOS - no callbacks from actual BLE device but didRangeBeacons gets called when another iOS device is used as broadcaster 我可以从同一WiFi网络上的另一台iOS设备访问iOS设备的“文档”目录吗? - Can I access Documents directory of an iOS device from another iOS device on same wifi network? 是否可以将声音从一台iOS设备播放到另一台iOS设备? - Is it possible to play sound from one iOS device to another? 从一台iOS设备直接拨打VoIP电话 - Direct VoIP call from one iOS device to another
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM