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

我试过这段代码. http://www.mediafire.com/download/bvoqrkn82sd6az9/tablesample.zip ..在这里,它将显示表格视图.但是每当我点击按钮时我都需要创建一个tableview,它应该显示Tableview列表,就像在这个截图中一样下拉列表. http://img.laike.net/iso20200222055316.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!");
                         }];

以上是来客网为你收集整理的ios – 如何在iPhone上的Button Click上显示TableView(如下拉列表)?全部内容,希望文章能够帮你解决ios – 如何在iPhone上的Button Click上显示TableView(如下拉列表)?所遇到的程序开发问题。

如果觉得来客网网站内容还不错,欢迎将来客网网站推荐给程序员好友。