本文转载至 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. Android上怎样使用《贝赛尔曲线》

    首先对于<赛贝尔曲线>不是很了解的童鞋,请自觉白度百科.google. 为了方便偷懒的童鞋,这里给个<贝赛尔曲线>百科地址,以及一段话简述<贝赛尔曲线>: < ...

  2. List多个字段标识过滤

    class Program {  public static void Main(string[] args) { List<T> list = new List<T>(); ...

  3. 趣味SQL——创建指定的数据类型

    原创作品,出自 "深蓝的blog" 博客,深蓝的blog:http://blog.csdn.net/huangyanlong/article/details/46908843 趣味 ...

  4. tp数据库操作

    1.常见的数据库操作//插入记录// $insert=Db::execute("insert into tp_user (username,password) values ('dome', ...

  5. angular.js 动态插入删除dom节点

    angular.js 是新一代web开发框架,它轻松在web前端实现了MVC模式,相比 jquery 模式,这种新玩意竟然不需要开发者直接去操作dom . 作为前端开发而不去操作dom ,这简直是一个 ...

  6. 通过CLR API实现C++调用C#代码交互

    对于某些跨平台程序,这也就意味着只能在windows下使用了 不过最近.Net开源或许以后可以跨平台 之前花了一些时间研究COM方式调用,太繁琐不推荐. COM方式调用总结 后来尝试使用CLR C++ ...

  7. [elk]logstash统计api访问失败率

    处理原始日志 日志从moogoo导出来的 { "mobile" : "13612345678", "isp" : "中国移动_广东 ...

  8. Eclipse上Hadoop插件中Run On Hadoop原理[转]

    通过Eclipse的hadoop插件中的"run on hadoop"命令的原理:它不是把jar包发送到hadoop集群上去运行,而只是使用了hadoop集群上的hdfs,从hdf ...

  9. mysql 索引 大于等于 走不走索引 最左前缀

    你可以认为联合索引是闯关游戏的设计 例如你这个联合索引是state/city/zipCode 那么state就是第一关 city是第二关, zipCode就是第三关 你必须匹配了第一关,才能匹配第二关 ...

  10. javaweb reponse 写出文件

    Map map = getSearchValue(); File excelFile = orderService.getexportexcel(id,map); InputStream is = n ...