IOS7开发~新UI学起(一)
本文转载至:http://blog.csdn.net/lizhongfu2013/article/details/9124893
IOS7在UI方面发生了很大改变,所以感觉有必要重新审视的学习一下(新特性+以前未注意到的特性)。
现在开始了:
1、UIView:
a)view.clearsContextBeforeDrawing =YES <IOS6>
When the Clears Graphics Context (clearsContextBeforeDrawing) checkbox is selected, the drawingbuffer is automatically cleared to transparent black before the view is drawn. This behavior ensures thatthere are no visual artifacts left over when the view’s contents are redrawn. (UIView每次重会之前,清除掉上次的内容,由于系统默认就是YES,所以忽略这个特性了,这个特性不是IOS7才有的)
b)Appearance Proxies <IOS6>
代码和效果图:
1>To customize the appearance of all instances of a class, useappearanceto get the appearance proxy forthe class (让某一类控件同时表现某种属性)
[[UIButton appearance]setBackgroundColor:[UIColorredColor]];
[[UIButton appearance]setTitle:@"ssss"forState:UIControlStateNormal];
2>
To customize the appearances for instances of a class when contained within an instance of a containerclass, or instances in a hierarchy, you useappearanceWhenContainedIn:to get the appearance proxyfor the class. (
让某一类控件在另一种控件中同时表现某种属性
)
[[UIButton appearanceWhenContainedIn:[UIView class],nil] setTitleColor:[UIColor greenColor]
forState:UIControlStateNormal];
Appearance Proxies 特性在IOS7以前可用,但并不那么显眼,但IOS7之后,由于UI的外表的改变,看起来更明显了,如图:
注意:
You can use an appearance proxy to set particular appearance properties for all instances of a view in yourapplication. (所有继承自UIView的控件都有这个特征,只不过不同的控件会以不同的方式展现这个特性)
更多代码:
[[UISlider appearance] setMinimumTrackTintColor:[UIColor greenColor]];
[[UISlider appearanceWhenContainedIn:[UIView class], nil]
setMinimumTrackTintColor:[UIColor greenColor]];
c)Using Template Images <IOS7>
模版图片:
UIImage *myImage = [UIImage imageNamed:@"myImageFile.png"];
myImage = [myImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
UIImageRenderingModeAutomatic, // Use the default rendering mode for the context where the image is used
UIImageRenderingModeAlwaysOriginal, // Always draw the original image, without treating it as a template
UIImageRenderingModeAlwaysTemplate, // Always draw the image as a template image, ignoring its color information
这个不理解有什么用,高人指点~~
d)
Using Auto Layout with Views
看这几篇,应该可以入门:
UIActionSheet
不要吃惊,屏幕下方的真的是UIActionSheet,实现方式没有改变,但就是这样式……
UIActionSheet *actionSheet = [[UIActionSheetalloc]initWithTitle:nil
delegate:nil
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:@"Delete"
otherButtonTitles:@"one", @"two",nil];
[actionSheet showInView:self.view];
[[UIActivityIndicatorViewappearance]setColor:[UIColorblueColor]];
UIActivityIndicatorView *indicator = [[UIActivityIndicatorViewalloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
indicator.frame = CGRectMake(180,100,100,100);
[self.view addSubview:indicator];
[indicator startAnimating];
这样一看,转圈也好像顺眼多了。
实现方式没有改变
注意:
1、做版本兼容时候,发现 UIAlertView 的 visible 属性貌似失效了。
IOS7开发~新UI学起(一)的更多相关文章
- IOS7开发~新UI学起(三)
1.UITextView: A ) IOS7新增加的 UITextViewDelegate 方法: - (BOOL)textView:(UITextView *)textView shoul ...
- IOS7开发~新UI学起(四)
本文转载至 http://blog.csdn.net/lizhongfu2013/article/details/9166193 1.UITableView: UITableViewDelegate ...
- IOS7开发~新UI学起(二)
本文转载至 http://blog.csdn.net/lizhongfu2013/article/details/9133281 1.UINavigationBar: NSDictionary* at ...
- IOS7学习之路一(新UI之自定义UITableViewCell)
ios7 新升级之后界面有了很大的变化,xcode模拟器去掉了手机边框和home键,如果想回到主页面,可以按住shift+comment+r键.废话少说先展示一下新UI下UItableView设置为G ...
- 开发者所需要知道的iOS7 SDK新特性
iOS 7 春风又绿加州岸,物是人非又一年.WWDC 2013 keynote落下帷幕,新的iOS开发旅程也由此开启.在iOS7界面重大变革的背后,开发者们需要知道的又有哪些呢.同去年一样,我会先简单 ...
- iOS7 SDK新特性
春风又绿加州岸.物是人非又一年.WWDC 2013 keynote落下帷幕,新的iOS开发旅程也由此开启.在iOS7界面重大变革的背后,开发人员们须要知道的又有哪些呢.同去年一样,我会先简单纵览地介绍 ...
- UGUI的优点新UI系统
UGUI的优点新UI系统 第1章 新UI系统概述 UGUI的优点新UI系统,新的UI系统相较于旧的UI系统而言,是一个巨大的飞跃!有过旧UI系统使用体验的开发者,大部分都对它没有任何好感,以至于在过 ...
- Google 开发新的开源系统 Fuchsia
google 最新os 下载 https://github.com/fuchsia-mirror/magenta 本文转自:http://www.oschina.net/news/76094/goog ...
- Android开发 ---基本UI组件3:单选按钮、多选按钮、下拉列表、提交按钮、重置按钮、取消按钮
Android开发 ---基本UI组件2 1.activity_main.xml 描述: 定义一个用户注册按钮 <?xml version="1.0" encoding=&q ...
随机推荐
- ibatis/mybatis显示sql语句 log4j.properties配置文件
将ibatis/mybatis log4j运行级别调到DEBUG可以在控制台打印出ibatis运行的sql语句,方便调试: ### 设置Logger输出级别和输出目的地 ### log4j.rootL ...
- exception in initAndListen: 12596 old lock file, terminating
#mongd -f /etc/mongodb.conf时报错 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvamFjc29uX2JhaQ==/font/5a ...
- Scala, Groovy, Clojure, Jython, JRuby and Java ----我们的工作语言
在曾经的一封邮件中,我指出在众多改变中,最明显的一个就是:在java领地上的JVM上使用其它流行的语言的发展变得越来越快.一些老的和新的创建的基于JVM的语言---JRuby 和 Jython ,Ja ...
- some issues that you should be take care of when use the plupload module
1. the config arguments 'browse_button' should not be a single element like button etc. because in i ...
- tbnet编译
下载tbnet 下载地址:http://code.taobao.org/p/tb-common-utils/src/trunk/tbnet/ ,它的svn地址为:http://code.taobao. ...
- Oracle 10g如何对用户姓名,按首字母排序、查询
首先介绍Oracle 9i新增加的一个系统自带的排序函数 1.按首字母排序 在oracle9i中新增了按照拼音.部首.笔画排序功能.设置NLS_SORT值 SCHINESE_RADICA ...
- Android 使用PLDroidPlayer播放网络视频 依据视频角度自己主动旋转
近期由于项目需求 .须要播放网络视频 .于是乎 研究了一番 ,说说我遇到的那些坑 如今市面上有几个比較主流好用的第三方框架 Vitamio ( 体积比較大,有商业化风险 github:https:// ...
- ubuntu16.04安装jekyll 3.3.1
本次安装的ekyll为最新的3.3.1版本. 一.预备工作,因位jekyll需要很多软件的支持,所以准备工作要做足. Ruby (including development headers, v1.9 ...
- Atitit.web 视频播放器classid clsid 大总结quicktime,vlc 1. Classid的用处。用来指定播放器 1 2. <object> 标签用于包含对象,比如图像、音
Atitit.web 视频播放器classid clsid 大总结quicktime,vlc 1. Classid的用处.用来指定播放器 1 2. <object> 标签用于包含对象,比如 ...
- 访问子节点childNodes
访问子节点childNodes 访问选定元素节点下的所有子节点的列表,返回的值可以看作是一个数组,他具有length属性. 语法: elementNode.childNodes 注意: 如果选定的节点 ...