Is it important to design iPhone App layouts flexible?(灵活设计 iPhone App 布局重要吗?)
问题描述
我想知道在使用固定值在 neb 中设置视图的高度时是否会遇到麻烦.
I am wondering if I would run into troubles when setting the heights of my views in the neb with fixed values.
示例:状态栏的高度是已知的.是20个单位.那么在制作一个界面不错的视图时,当用户在使用 App 时接听电话,并且状态栏的高度增加了会发生什么?或者,如果 Apple 在未来的某一天更改状态栏或标签栏的高度会怎样?
Example: The height of the Status Bar is known. It's 20 units. So when making a view that shows an nice interface, what would happen when the user takes a phone call while using the App, and the Status Bar increases in height? Or what if Apple changes the height of the Status Bar, or Tab Bar, some day in future?
您是否总是对包含所有界面元素的容器视图使用自动调整大小功能?你的模式是什么?
Do you always use autoresizing features for your container-view that has all the interface elements inside? What's your pattern?
推荐答案
我会避免将状态栏、工具栏等高度的硬编码值放入您的程序中.您提供了一些很好的例子来说明这些值是如何动态变化的,并且在未来会发生变化.您可能支持也可能不支持的另一种常见情况是用户能够将 iPhone 旋转到横向.
I would steer clear of hard coding values for the heights of the status bar, tool bar, etc into your program. You present some good examples of how these values are dynamic and can change in the future. One other common scenario that you may or may not be supporting is the ability of the user to rotate the iPhone into landscape orientation.
我总是尝试保持容器子视图的布局灵活.使用自动调整大小功能是一个好方法.你的问题很好,我认为它会让我重新审视自己的布局策略!
I always try to keep the layout of the subviews of a container flexible. Using the autoresizing feature is a good approach. Your question is a good one and I think its going to make me review my own layout strategy!
这篇关于灵活设计 iPhone App 布局重要吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:灵活设计 iPhone App 布局重要吗?


基础教程推荐
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01