ios – 如何在iPhone上的Button Click上显示TableView(如下拉列表)?

前端之家收集整理的这篇文章主要介绍了ios – 如何在iPhone上的Button Click上显示TableView(如下拉列表)?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试过这段代码. 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!");
                         }];
原文链接:https://www.f2er.com/iOS/335434.html

猜你在找的iOS相关文章