iOS UI Element Usage
- Bars
- The Status Bar
The UIStatusBarStyle constant, controls the status bar style.
To specify the status bar style, you set a value in your Info.plist file. (For more information about the
contents of this file, see “UIKit Keys”; to learn how to set values, see Property List Editor Help .)
一般不建议自定义状态栏,主要考虑到兼容性
On iPhone, specify the color of the status bar. You can choose gray (the default color), opaque black, or
translucent black (that is, black with an alpha value of 0.5).
Be sure to choose a status bar appearance that coordinates with the rest of your iPhone app. For example,
avoid using a translucent status bar if the navigation bar is opaque. 避免使用同名的状态栏如果导航栏不是透明的。
On iPhone, set whether the change in status bar color should be animated. Note that the animation causes
the old status bar to slide up until it disappears off the screen while the new status bar slides into place.
- Navigation Bar UINavigationBar
A navigation bar enables navigation through an information hierarchy and, optionally, management of screen
contents.A navigation bar is contained in a navigation controller, which is an object that manages the display of your
hierarchy of custom views
On iPhone, changing the device orientation from portrait to landscape can change the height of the navigation
bar automatically. On iPad, the height and translucency of a navigation bar doesn’t change with rotation.
On iPhone, a navigation bar always displays across the full width of the screen. On iPad, a navigation bar can
display within a view—such as one pane of a split view—that doesn’t extend across the screen.
在iphone中如果改变设备的方向会自动改变状态条的高度。而在ipad中状态条的高度和透明度时不会随着旋转而改变的。iphone中状态条的宽度总是全屏的宽度,
在ipad中,状态条却是可以显示在一个视图中的。
- Use the title of the current view as the title of the navigation bar.
- Use system-provided buttons according to their documented meaning.
- If appropriate, customize the appearance of a navigation bar to coordinate with the look of your app.
- If appropriate, customize the appearance of navigation-bar controls.
- Make sure that a customized back button still looks like a back button.
On iPhone, be prepared for the change in navigation bar height that occurs on device rotation. In particular,
make sure that your custom navigation bar icons fit well in the thinner bar that appears in landscape orientation.
Don’t specify the height of a navigation bar programmatically; instead, you can take advantage of the
UIBarMetrics constants to ensure that your content fits well.
在iphone中注意横屏时导航栏的高度变化,不要在程序中指定导航栏的高度,而是可以利用UIBarMetrics来使得内容适配。
- Toolbar UIToolbar
A toolbar contains controls that perform actions related to objects in the screen or view.
A toolbar is typically contained in a navigation controller, which is an object that manages the display of a
hierarchy of custom views. toolbar一般都会嵌入到navigation controller中
On iPhone, a toolbar always appears at the bottom edge of a screen or view, but on iPad it can instead appear
at the top edge. 在iphone中经常出现在屏幕或者视图的下方,但是在ipad中却是可以显示在上方的。
On iPhone, changing the device orientation from portrait to landscape can change the height of the toolbar
automatically. On iPad, the height and translucency of a toolbar don’t change with rotation.
iphone中屏幕旋转会改变工具条的高度,但是在ipad中却不会改变
- Maintain a hit target area of at least 44 x 44 points for each toolbar item. If you crowd toolbar items too closely together, people have difficulty tapping the one they want.
- On iPhone, be prepared for the change in toolbar height that occurs on device rotation
- Tab Bar UITabBar
On iPhone, a tab bar can display no more than five tabs at one time; if the app has more tabs, the tab bar
displays four of them and adds the More tab, which reveals the additional tabs in a list. On iPad, a tab bar can
display more than five tabs.
在iphone中tab bar只能一次显示5个tabs,如果有多余的会显示more tab,而ipad中却是可以显示超过5个tab的
- Don’t use a tab bar to give users controls that act on elements in the current mode or screen
2, Content Views
- Create a streamlined image that represents your service.
- Create the image in the following sizes:
For iPhone and iPod touch: About 43 x 43 pixels About 86 x 86 pixels (high resolution)
For iPad:About 55 x 55 pixels About 110 x 110 pixels (high resolution)
- Image View UIImageView
- Scroll View UIScrollView
- A scroll view helps people see content that is larger than the scroll view’s boundaries (the image shown below is both taller and wider than the scroll view that contains it).
- Support zoom behavior appropriately.
- Consider using a page control with a paging-mode scroll view.
- In general, display only one scroll view at a time.
- Split View(iPad Only) UISplitViewController
A split view is a full-screen view that consists of two side-by-side panes.
- Table View UITableView
A table view presents data in a single-column list of multiple rows.
- Plain tables
- Grouped tables
- Text View UITextView
- Web View UIWebView
- Alerts, Action Sheets, and Modal Views
- An action sheet displays a set of choices related to a task the user initiates (shown below on iPhone). UIActionSheet
An action sheet has two different appearances. On iPhone, an action sheet always emerges from the bottom
of the screen and hovers over the app’s views (an action sheet for Safari on iPhone is shown above). The side
edges of an action sheet are anchored to the sides of the screen, which reinforces its connection to the app
and to the user’s most recent action.
On iPad, an action sheet is always displayed within a popover; it never has full-screen width (to learn more
about popovers, see “Popover (iPad Only)” (page 144)). An action sheet can cause a popover to appear, or it
can appear within a popover that’s already open. In both cases, there’s a strong visual connection between
the action sheet and the user’s action. For example, the action sheet shown here is displayed when the user
taps the Mail Reply button on iPad.
On iPhone, coordinate the action sheet background appearance with the navigation bars and toolbars.
On iPhone, include a Cancel button so that users can easily and safely abandon the task
On iPad, choose whether to display an action sheet with animation or without animation.
Avoid making users scroll through an action sheet.
On both devices, use the red button color if a potentially destructive action can be performed.
- Controls
Activity Indicator UIActivityIndicatorView
An activity indicator shows that a task or process is progressing (shown here with a label).
Date Picker UIDatePicker
A date picker displays components of date and time, such as hours, minutes, days, and years.
Picker UIPickerView
A picker displays a set of values from which a user picks one.
Progress View UIProgressView
Refresh Control UIRefreshControl
A refresh control performs a user-initiated content refresh—typically in a table (shown here above the mailbox
list).
Scope Bar UISearchBar
A scope bar—which is available only in conjunction with a search bar—allows users to define the scope of a
search (shown here below a search bar).
Stepper UIStepper
A stepper increases or decreases a value by a constant amount.
Table 7-2 Standard buttons available for toolbars and navigation bars (plain style)
Table 7-3 Bordered action buttons for use in navigation bars and toolbars
Standard Icons for Use in Tab Bars
Standard Buttons for Use in Table Rows and Other UI Elements
Custom Icon and Image Creation Guidelines
Create different sizes of your app icon for different devices. If you’re creating a universal app, you need to
supply app icons in all four sizes.
For iPhone and iPod touch both of these sizes are required:
● 57 x 57 pixels
● 114 x 114 pixels (high resolution)
For iPad, both of these sizes are required:
● 72 x 72 pixels
● 144 x 144 (high resolution)
When iOS displays your app icon on the Home screen of a device, it automatically adds the following visual
effects:
● Rounded corners
● Drop shadow
● Reflective shine (unless you prevent the shine effect)
For the App Store, create a large version of your app icon in two sizes so that it looks good on all devices:
● 512 x 512 pixels
● 1024 x 1024 pixels (high resolution)
Launch Images
For iPhone and iPod touch launch images, include the status bar region. Create launch images of the
following sizes.
For standard iPhone and iPod touch devices:
● 320 x 480 pixels
● 640 x 960 pixels (high resolution)
For iPhone 5 and iPod touch (5th generation):
● 640 x 1136 pixels
For iPad launch images, do not include the status bar region. Create launch images of these sizes (most iPad
apps should supply a launch image for each orientation):
● For portrait:
● 768 x 1004 pixels
● 1536 x 2008 pixels (high resolution)
● For landscape:
● 1024 x 748 pixels
● 2048 x 1496 pixels (high resolution)
Small Icons
For iPhone and iPod touch, iOS uses the same icon for both Spotlight search results and Settings. If you do not
provide this icon, iOS might shrink your app icon for display in search results and in Settings. For your iPhone
app, create two small icons that measure:
● 29 x 29 pixels
● 58 x 58 pixels (high resolution)
For iPad, you supply separate icons for Settings and Spotlight search results. For Settings on iPad, create two
icons that measure:
● 29 x 29 pixels
● 58 x 58 pixels (high resolution)
For Spotlight search results on iPad, create two icons that measure:
● 50 x 50 pixels
● 100 x 100 pixels (high resolution)
Icons for Navigation Bars, Toolbars, and Tab Bars
For toolbar and navigation bar icons on iPhone, iPod touch, and iPad, create an icon in the following sizes:
● About 20 x 20 pixels
● About 40 x 40 pixels (high resolution)
For tab bar icons on iPhone, iPod touch, and iPad, create an icon in the following sizes:
● About 30 x 30 pixels (48 x 32 pixels maximum)
● About 60 x 60 pixels (96 x 64 pixels maximum) for high resolution
iOS UI Element Usage的更多相关文章
- [IOS]IOS UI指南
[IOS]IOS UI指南 众所周知,IOS的界面设计,越来越流行,可以说都形成了一个标准,搜集了一些资料,供自己以后学习使用! iOS Human Interface Guidelines (中文翻 ...
- IOS UI 第八篇:基本UI
实现图片的滚动,并且自动停止在每张图片上 - (void)viewDidLoad{ [super viewDidLoad]; UIScrollView *scrollView = [[U ...
- 国外IOS UI指南
国外IOS UI指南 众所周知,IOS的界面设计,越来越流行,可以说都形成了一个标准,搜集了一些资料,供自己以后学习使用! iOS Human Interface Guidelines (中文翻译) ...
- iOS UI的几种模式
iOS UI的几种模式: 1.平凡模式(原生控件组合): 2.新闻模式: 3.播放器模式: 4.微博模式:
- 通过实现一个TableView来理解iOS UI编程
推荐一篇神作: 通过实现一个TableView来理解iOS UI编程 http://blog.jobbole.com/61101/
- [iOS UI设计笔记整理汇总]
8.UIsearchbar放到Navigationbar 上(意思是建个View作为titleview) //此处调用的是第三方封装的SearchBar,也可以自定义. self.searchBarW ...
- iOS UI高级之网络编程(HTTP协议)
HTTP协议的概念 HTTP协议,Hyper Text Transfer Protocol (超文本传输协议)是用于从万维网服务器传送超文本到本地浏览器的传输协议,HTTP是一个应用层协议,由请求和响 ...
- iOS - UI - UIWebView
1.UIWebView UIWebView 是 苹果提供的用来展示网页的UI控件.它也是最占内存的控件. iOS8.0 webkit框架. WKWebView,相比UIWebView,节省了1/3~1 ...
- [iOS UI进阶 - 0] Quiartz2D
A.简介 1. 需要掌握的 drawRect:方法的使用 常见图形的绘制:线条.多边形.圆 绘图状态的设置:文字颜色.线宽等 图形上下文状态的保存与恢复 图形上下文栈 1.基本图形绘制* 线段(线宽. ...
随机推荐
- SXCPC2018 nucoj2004 国王的怪癖
可持久化trie.考场上我脑补了一个trie树合并也A了 #include <iostream> #include <cstring> #include <cstdio& ...
- IOS开发---菜鸟学习之路--(二)-数据获取
第二篇了. 本篇要讲的是数据获取. 为什么将数据获取放在第二篇就讲呢? 因为我在看别人教程的时候都是先讲控件的属性,然后怎么用控件开始. 可是毕竟咱们也是有一定开发经验的人..所以很自然就想先知道怎么 ...
- bugku 普通的二维码
记录下对进制转换实现的重新思考. 扫描二维码扫到了一句垃圾话. 拖到winhex里面. 一开始以为是十进制直接转ascii,发现错误. 后来发现,最大数是7,八进制转换吧. 我是打算用python的l ...
- Leetcode 493.翻转对
翻转对 给定一个数组 nums ,如果 i < j 且 nums[i] > 2*nums[j] 我们就将 (i, j) 称作一个重要翻转对. 你需要返回给定数组中的重要翻转对的数量. 示例 ...
- 集训队日常训练20181117 DIV2
大佬们一顿操作猛如虎,拼命AC强啊 4262: 区间异或 Time Limit(Common/Java):1000MS/3000MS Memory Limit:65536KByteTotal ...
- (转载)CentOS 6.5使用aliyun镜像来源
(原地址:http://www.linuxidc.com/Linux/2014-09/106675.htm) 当我们把CentOS 6.5安装好以后,可以使用这个脚本来使用国内的阿里云镜像源 #!/b ...
- Proteus中常用元器件名字
运放 OPAMP 稳压管 zener MOS管 IRC 串口 COMPIM
- javaScript 笔记(4) -- 弹窗 & 计时事件 & cookie
弹窗 可以在 JavaScript 中创建三种消息框:警告框.确认框.提示框. 警告框:经常用于确保用户可以得到某些信息. 当警告框出现后,用户需要点击确定按钮才能继续进行操作. 语法: window ...
- Nginx + tomcat 实现简单集群(基于反向代理方式)
一.安装 nginx 1. nginx依赖以下一些软件库,在安装之前请确保安装了这些软件库,它们包括:gcc,openssl,zlib,pcre(可通过rpm -q命令查询是否已安装) 可通过命令 r ...
- 一个简单的NoSQL内存数据库—Berkeley DB基本操作的例子
一个简单的NoSQL内存数据库—Berkeley DB基本操作的例子 最近,由于云计算的发展,数据库技术也从结构式数据库发展到NoSQL数据库,存储模式从结构化的关系存储到现在如火如荼的key/val ...