糗事百科一点小总结

来源:互联网 发布:joo yeon seo 编辑:程序博客网 时间:2024/04/29 20:48

1. colorWithPatternImage这个方法可用来设置背景与某一图片背景相似

[self.viewsetBackgroundColor:[UIColorcolorWithPatternImage:[UIImageimageNamed:@"main_background.png"]]];

2.关于弹出模态对话框(即一个viewcontroller弹出另一个viewcontroller):(以前貌似实现过,后来忘了又)

其实相当easy,就两函数:

若A要弹出B,则在A里写 presentModalViewController  例:

comment.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal; //这个可用来设定弹出的样式,总共有四种呢,挺好看

    [selfpresentModalViewController:commentanimated:YES];

在B里写 dismissModalViewControllerAnimated 这个可实现返回A(这个也是一句话搞定)

[selfdismissModalViewControllerAnimated:YES];


给个实例看看吧:http://www.cnblogs.com/smileEvday/archive/2012/10/14/PresentModalViewController2.html


3.刚知道,貌似可以把一个tableview的 tableHeaderView设为另一个tableview

见 糗百 

CommentsViewController.m 里的 113 行 

commentView.tableHeaderView =tableView;