iOS应用仅在模拟器中显示一半 [英] iOS app only showing half in simulator

查看:130
本文介绍了iOS应用仅在模拟器中显示一半的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为iOS开发带有一个屏幕的简单应用程序,并且遇到了一个奇怪的问题.只有一半的应用程序显示.例如,我有一个屏幕,屏幕中央只有一个按钮.当我在模拟器中运行该应用程序时,我只能看到按钮的一半,也不能移动它.我可以在模拟器中垂直滚动视图,但不能水平滚动视图.我感到难过.将不胜感激任何指针.

I am trying to develop a simple app with one screen for iOS and am running into a strange problem. Only half of the app is showing up. For example I have a screen with just one button in the center of the screen. When I run the app in the simulator I only see half the button and I cannot move it either.I can scroll the view in the simulator vertically but not horizontally. I am stumped. Will appreciate any pointers.

推荐答案

我很确定您使用主故事板构建了视图,并将所有内容放在其中.主故事板设置为将所有iOS格式(iPhone和iPad)都考虑在内.如果希望您的应用程序显示在iOS设备上的中心位置,则需要使用自动布局"来限制不同UI对象的位置.这样,无论您使用什么设备,它都会自动居中显示

I'm pretty sure you built your view using the main storyboard and put everything in the middle of it. The main storyboard is set to take all iOS format into account, iPhone and iPad. If you want your app to appear centered on your iOS device, you need to constraint the position of your different UI objects, using Auto Layout. That way it would appear centered automatically, whatever is the device you're using

这篇关于iOS应用仅在模拟器中显示一半的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆