本文转载至: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

看这几篇,应该可以入门:

 
2、

UIActionSheet

:<IOS7样式>

不要吃惊,屏幕下方的真的是UIActionSheet,实现方式没有改变,但就是这样式……

UIActionSheet *actionSheet = [[UIActionSheetalloc]initWithTitle:nil

delegate:nil

cancelButtonTitle:@"Cancel"

destructiveButtonTitle:@"Delete"

otherButtonTitles:@"one", @"two",nil];

[actionSheet showInView:self.view];

3、UIActivityIndicatorView

[[UIActivityIndicatorViewappearance]setColor:[UIColorblueColor]];

UIActivityIndicatorView *indicator = [[UIActivityIndicatorViewalloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];

indicator.frame = CGRectMake(180,100,100,100);

[self.view addSubview:indicator];

[indicator startAnimating];

   这样一看,转圈也好像顺眼多了。

4、UIAlertView:
<IOS7样式>

实现方式没有改变

注意:

1、做版本兼容时候,发现 UIAlertView 的 visible 属性貌似失效了。

 
5、UICollectionView  :
<IOS6>
高级控件,适合做相册效果:http://blog.sina.com.cn/s/blog_5a6efa330101doc9.html

IOS7开发~新UI学起(一)的更多相关文章

  1. IOS7开发~新UI学起(三)

    1.UITextView: A )      IOS7新增加的 UITextViewDelegate 方法: - (BOOL)textView:(UITextView *)textView shoul ...

  2. IOS7开发~新UI学起(四)

    本文转载至 http://blog.csdn.net/lizhongfu2013/article/details/9166193 1.UITableView: UITableViewDelegate ...

  3. IOS7开发~新UI学起(二)

    本文转载至 http://blog.csdn.net/lizhongfu2013/article/details/9133281 1.UINavigationBar: NSDictionary* at ...

  4. IOS7学习之路一(新UI之自定义UITableViewCell)

    ios7 新升级之后界面有了很大的变化,xcode模拟器去掉了手机边框和home键,如果想回到主页面,可以按住shift+comment+r键.废话少说先展示一下新UI下UItableView设置为G ...

  5. 开发者所需要知道的iOS7 SDK新特性

    iOS 7 春风又绿加州岸,物是人非又一年.WWDC 2013 keynote落下帷幕,新的iOS开发旅程也由此开启.在iOS7界面重大变革的背后,开发者们需要知道的又有哪些呢.同去年一样,我会先简单 ...

  6. iOS7 SDK新特性

    春风又绿加州岸.物是人非又一年.WWDC 2013 keynote落下帷幕,新的iOS开发旅程也由此开启.在iOS7界面重大变革的背后,开发人员们须要知道的又有哪些呢.同去年一样,我会先简单纵览地介绍 ...

  7. UGUI的优点新UI系统

    UGUI的优点新UI系统 第1章  新UI系统概述 UGUI的优点新UI系统,新的UI系统相较于旧的UI系统而言,是一个巨大的飞跃!有过旧UI系统使用体验的开发者,大部分都对它没有任何好感,以至于在过 ...

  8. Google 开发新的开源系统 Fuchsia

    google 最新os 下载 https://github.com/fuchsia-mirror/magenta 本文转自:http://www.oschina.net/news/76094/goog ...

  9. Android开发 ---基本UI组件3:单选按钮、多选按钮、下拉列表、提交按钮、重置按钮、取消按钮

    Android开发 ---基本UI组件2 1.activity_main.xml 描述: 定义一个用户注册按钮 <?xml version="1.0" encoding=&q ...

随机推荐

  1. ASIHTTPRequest 简单使用

    ASIHTTPResquest 框架功能强大,应用非常多. 曾经写过ASIHTTPResquest的导入,如今就看一下基本使用 记一下当中基础的操作: 1.发送同步请求: NSURL * url = ...

  2. Python根据系统环境配置日志,Python配置日志 Python logger

    我们通常在写爬虫的时候,需要配置日志,但是有可能是在windows开发的,但是程序的运行环境可是是在Linux中,这时候我们就需要不停的更换日志的目录了 但是我们可以实现通过判断不同的运行环境,来时间 ...

  3. 安卓-APP安装后多个图标的解决

    原因是在不同Activity的intent中配置了多个LAUNCHER. <intent-filter> <action android:name="android.int ...

  4. 浅谈I2C总线

    I2C总线概述 I2C(Inter-Integrated Circuit)总线是一种由PHILIPS公司在80年代开发的两线式串行总线,用于连接微控制器及其外围设备.I2C总线最主要的优点是其简单性和 ...

  5. JMeter学习笔记(三)

    D. User Defined Variables:用户自定义的变量,在此我们可以定义后面原件需要引用的变量并对其进行赋值.jsessionid一般是服务器返回的,每个用户返回的都不一样,所以在此不应 ...

  6. C++ virtual继承

    C++ virtual继承的还有一种名称是菱形继承.主要目的是用于解决从不同类继承来的同名数据成员在内存中有不同的拷贝.造成数据不统一的问题,以致于在进行类释放时造成内存泄漏. 将共同的基类作为虚基类 ...

  7. [转]C++中的三种继承public,protected,private

    链接:http://www.cnblogs.com/BeyondAnyTime/archive/2012/05/23/2514964.html

  8. pentestbox使用教程

    pentestbox工具列表:https://tools.pentestbox.org/ freebuf入门实战:http://www.freebuf.com/sectool/125881.html ...

  9. lua工具库penlight--05日期和时间

    创建和显示时间 Date类提过了简洁的使用date和time的方法.它依赖于os.date和os.time. Date对象可以通过table创建,如果os.date,同时提过了获取和设置date 成员 ...

  10. Unity3D 5.0版本+注册工具分享

    Unity3D引擎5.0正式版本发布也有一段时间了.笔者今天下载了新版本顺便分享一下资源. 主要有两个资源,一个是5.0f4的官方客户端,另外一个是vs的调试插件.有需要的盆友就拿去.都在下面的连接地 ...