资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

IOS7开发~新UI学起-创新互联

1、UITableView:

作为一家“创意+整合+营销”的成都网站建设机构,我们在业内良好的客户口碑。成都创新互联提供从前期的网站品牌分析策划、网站设计、网站设计制作、做网站、创意表现、网页制作、系统开发以及后续网站营销运营等一系列服务,帮助企业打造创新的互联网品牌经营模式与有效的网络营销方法,创造更大的价值。

IOS7开发~新UI学起

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

return40;

} 然后这个方法才返回真正的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:

IOS7开发~新UI学起

不想说什么了~

4、UISteper:

- (void)viewDidLoad

{

[superviewDidLoad];

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

myStepper.backgroundColor = [UIColorredColor];

[myStepper addTarget:self

action:@selector(myAction:)

forControlEvents:UIControlEventValueChanged];

[self.viewaddSubview:myStepper];

}

- (void) myAction:(UIStepper *) sender

{

CFShow((__bridgeCFTypeRef)(@(sender.value)));

}

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


标题名称:IOS7开发~新UI学起-创新互联
文章转载:http://cdkjz.cn/article/djcdoj.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220