我试过这段代码.
http://www.mediafire.com/download/bvoqrkn82sd6az9/tablesample.zip ..在这里,它将显示表格视图.但是每当我点击按钮时我都需要创建一个tableview,它应该显示Tableview列表,就像在这个截图中一样下拉列表.
http://www.mediafire.com/download/7jiwb0e00916gh9/Table+View.PNG这是我需要展示的内容.非常感谢您的帮助.提前致谢.
解决方法
您可以使用动画更改tableView的高度.根据您的适用性设定时间.
扩展:
- [UIView animateWithDuration:1
- delay:0.0
- options: UIViewAnimationYourChoice
- animations:^{
- CGRect frame = self.tableView.frame;
- frame.size.height = 300;
- self.tableView.frame = frame;
- }
- completion:^(BOOL finished){
- NSLog(@"Done!");
- }];
缩小:
- [UIView animateWithDuration:1
- delay:0.0
- options: UIViewAnimationYourChoice
- animations:^{
- CGRect frame = self.tableView.frame;
- frame.size.height = 0;
- self.tableView.frame = frame;
- }
- completion:^(BOOL finished){
- NSLog(@"Done!");
- }];