我有一個UITableViewController
與底部的UIView
。 (使用故事板)。我的UIView
設置爲隱藏,然後通過單擊按鈕更改狀態。首先,我試圖使用self.concluidoView.frame = CGRectMake(0, 0, 320, 50);
來調整IBAction
(buttonClick)上UIView的大小(基本上增加高度),但是UIView正在消失。現在UITableView擴展子視圖後不夠滾動
,它正確地用下面的代碼裏面IBAction
擴大UIView
:
[UIView animateWithDuration:1.0
animations:^{
CGRect frame = self.concluidoView.frame;
frame.size.height += 100.0;
self.concluidoView.frame = frame;
}
completion:^(BOOL finished){
// complete
}];
的問題是,我的UITableViewController沒有滾動足夠的新的大小,因爲UIView
是我tableView
的最後一個項目。
我已經嘗試了幾件事情來解決這個問題,包括手動嘗試調整tableview
以將其高度增加到UIView
增加的相同值。我用下面的代碼:
CGRect tableFrame = self.tableview.frame;
tableFrame.size.height += 100;
self.tableView.frame = tableFrame;
[self.tableview layoutIfNeeded];
我tableview
的滾動能力爲這個代碼後實際更小。我想調整tableview
並允許手動滾動,因爲我知道我的subview
會增加多少或自動增加。
完美!這樣做的工作,我有我的'UIView'在'@屬性',所以我只是'tableFooterView'分配給它。謝謝。 – Jorge