【问题标题】:How to display the tableview in dropdown list on Button Click in iPhone?如何在 iPhone 中单击按钮的下拉列表中显示 tableview?
【发布时间】:2013-10-28 07:16:42
【问题描述】:
【问题讨论】:
标签:
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!");
}];