【问题标题】:How to display the tableview in dropdown list on Button Click in iPhone?如何在 iPhone 中单击按钮的下拉列表中显示 tableview?
【发布时间】:2013-10-28 07:16:42
【问题描述】:

我已经尝试过这段代码。 http://www.mediafire.com/download/bvoqrkn82sd6az9/tablesample.zip ..在这里,我需要这样.. 每当我单击显示按钮时,它应该显示 Tableview 的列表,如此屏幕截图中的下拉列表。加载时,应隐藏表格视图。单击按钮时,应显示表格视图。非常感谢您的帮助。提前致谢。

【问题讨论】:

标签: ios iphone objective-c uitableview buttonclick


【解决方案1】:

您可以通过动画更改 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!");
                         }];

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-08-19
    • 2013-11-06
    • 2021-11-21
    • 1970-01-01
    • 2019-03-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多