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

1、UITableView:

UITableViewDelegate 新增内容:

// Use the estimatedHeigh(估算高度)t methods to quickly calcuate guessed values which will allow for fast load times of the table.

// If these methods are implemented, the above -tableView:heightForXXX calls will be deferred until views are ready to be displayed, so more expensive logic can be placed there.

- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath

{

return50;

}  //  这个方法先返回一个估算的cell高度

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

{    kPrintInfo

return 40;

} 然后这个方法才返回真正的cell高度

这两个方法同理

- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForHeaderInSection:(NSInteger)section;

- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForFooterInSection:(NSInteger)section;

新增属性:

@property(nonatomic)         CGFloat                    estimatedRowHeight ;// default is 0, which means there is no estimate

@property(nonatomic)         CGFloat                    estimatedSectionHeaderHeight ;// default is 0, which means there is no estimate

@property(nonatomic)         CGFloat                    estimatedSectionFooterHeight ;// default is 0,

通过新增代理放大不难知道,上述三个新增属性不难理解了。

// the background color of the section index while not being touched(当section不被触摸时候的背景颜色)

@property(nonatomic,retain)UIColor *sectionIndexBackgroundColor;

2、UIButton:

UIButton的这个属性是 IOS6引入的,以前没注意到:

- (void)setAttributedTitle:(NSAttributedString *)title forState:(UIControlState)stateNS_AVAILABLE_IOS(6_0);// default is nil. title is assumed to be single line

用法如下:

- (NSMutableAttributedString *) getString

{

NSMutableAttributedString *attriString = [[NSMutableAttributedStringalloc]initWithString:@"this is test!"];

//改变this的字体,value必须是一个CTFontRef

[attriString addAttribute:(NSString *)kCTFontAttributeName

value:CFBridgingRelease(CTFontCreateWithName((CFStringRef)[UIFontboldSystemFontOfSize:14].fontName,14,NULL))

range:NSMakeRange(0,4)];

//给this加上下划线,value可以在指定的枚举中选择

[attriString addAttribute:(NSString *)kCTUnderlineStyleAttributeName

value:(id)[NSNumbernumberWithInt:kCTUnderlineStyleDouble]

range:NSMakeRange(0,4)];

return attriString;

}

- (void)viewDidLoad

{

[superviewDidLoad];

[btsetAttributedTitle:[selfgetString]forState:UIControlStateNormal];

}

3、UIDatePicker:

不想说什么了~

4、UISteper:

- (void)viewDidLoad

{

[super viewDidLoad];

UIStepper *myStepper = [[UIStepper alloc] initWithFrame:CGRectMake(0, 10, 320, 50)];

myStepper.backgroundColor = [UIColor redColor];

[myStepper addTarget:self

action:@selector(myAction:)

forControlEvents:UIControlEventValueChanged];

[self.view addSubview:myStepper];

}

- (void) myAction:(UIStepper *) sender

{

CFShow((__bridge CFTypeRef)(@(sender.value)));

}

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

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

    本文转载至:http://blog.csdn.net/lizhongfu2013/article/details/9124893 IOS7在UI方面发生了很大改变,所以感觉有必要重新审视的学习一下(新 ...

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

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

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

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

  4. 四核驱动的三维导航—淘宝新UI(设计篇)

    前面有一篇博客说到了淘宝UWP的"四核驱动的三维导航—淘宝新UI(需求分析篇)",花了两周的时间实现了这个框架,然后又陆陆续续用了三周的时间完善它. 多窗口导航,与传统的导航方式的 ...

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

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

  6. UGUI的优点新UI系统四 开源

    UGUI的优点新UI系统四 开源 新UI系统是开源的,所以开发者可以看到新UI系统实现的源码,并加以修改和使用. 开源授权协议——MIT/X11 Unity所搭载的新UI系统,是在开源授权协议MIT/ ...

  7. Mina、Netty、Twisted一起学(四):定制自己的协议

    在前面的博文中,介绍一些消息分割的方案,以及MINA.Netty.Twisted针对这些方案提供的相关API.例如MINA的TextLineCodecFactory.PrefixedStringCod ...

  8. iOS开发~UI布局(三)深入理解autolayout

    一.概要 通过对iOS8界面布局的学习和总结,发现autolayout才是主角,autolayout是iOS6引入的新特性,当时还粗浅的学习了下,可是没有真正应用到项目中.随着iOS设备尺寸逐渐碎片化 ...

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

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

随机推荐

  1. CentOS 6.3下Samba服务器的安装与配置(转)

    一.简介 Samba是一个能让Linux系统应用Microsoft网络通讯协议的软件,而SMB是Server Message Block的缩写,即为服务器消息块 ,SMB主要是作为Microsoft的 ...

  2. static 与单例模式、auto_ptr与单例模式、const 用法小结、mutable修饰符

    一.static 与单例模式 单例模式也就是简单的一种设计模式,它需要: 保证一个类只有一个实例,并提供一个全局访问点 禁止拷贝  C++ Code  1 2 3 4 5 6 7 8 9 10 11 ...

  3. VB命令行参数分隔, 类似C语言中的main(int argc, char* argv[])

    VB6.0为了提供命令行参数的支持,提供了Command()接口,于是通过 Command() 函数可以得到所有传入的参数,但是很不友好的是,VB的所有参数都被合在了一起,成为了一个字符串,当有多个参 ...

  4. ruby配置相关

    1.安装ruby 方式1: yum install ruby 方式2:https://www.ruby-lang.org/en/downloads/ 使用源码安装 ./configure make m ...

  5. Q_PROPERTY介绍

    QT提供了一个成熟的属性系统,但是作为一个跨平台的且与编译器无关的库,qt不依赖于非标准的编译器功能例如 __property or [property]: QT的强大之处在于它可以支持任何标准的c+ ...

  6. git配置文件读取顺序

    作者:zhanhailiang 日期:2014-11-03 git包括三个配置文件: /etc/gitconfig 文件:系统中对全部用户都普遍适用的配置. 若使用git config 时用' –sy ...

  7. c语言中各种数据类型的长度

    在32位平台和64位平台上,同一种数据类型可能有不同的数据长度: 类型 32位平台 64位平台 char 1 1 short 2 2 int 4 4 long 4 8 long long 8 8 fl ...

  8. 11个常用的Linux命令

    Linux命令行吸引了大多数Linux爱好者.一个正常的Linux用户一般掌握大约50-60个命令来处理每日的任务.今天为你解释下面几个命令:sudo.python.mtr.Ctrl+x+e.nl.s ...

  9. docker容器跑tomcat遇到的坑

    使用docker容器跑tomcat,由于同一个宿主机上跑了多个容器,再加上宿主机本身跑了很多进程,导致系统总的进程数达到了8000+,而容器中tomcat的启动脚本中会调用自带的setenv.sh,在 ...

  10. sim900GPRS模块ppp拨号上网

    --------------------------------------------- 主机操作系统:Centos 6.5 交叉编译器环境:arm-linux-gcc-4.5.4 开发板平台: F ...