0
默認情況下,每個部分應顯示最多三個單元格。如果任何單元格包含多於三個單元格,則應該顯示'show more'選項。如果show more被點擊,我想在該特定部分中顯示其餘單元格。我花了兩天時間,沒有什麼能解決的。桌子頂部的部分。取決於選擇的段,tableview加載單元格。這段代碼對於每個段每段都不相同,所以func cellForRowAtIndexPath:
變得很大很大。我大致添加了代碼。這段代碼就是我試過的。Display在uitableview中顯示更多
if segmentName == .Feature || segmentName == .Services
{
if indexPath.section == 0
{
if boolShowFullFeature[indexPath.section] == false
{
if indexPath.row == showCells
{
return createShowMoreCell(indexPath.section)
}
else
{
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! SearchListViewCell
var firstTitle = "", secondTitle = "", thirdTitle = "", recomendValue = "", starValue = ""
(firstTitle, secondTitle, thirdTitle, recomendValue, starValue) = model.foodValue[indexPath.row]
cell.configureCell(firstTitle, secondTitle: secondTitle, thirdTitle: thirdTitle, recomendValue: recomendValue, starValue: starValue)
return cell
這是一些有趣的信息。你也有問題嗎? – dasdom
@Antony你試過了什麼?什麼工作?什麼沒有? – kostek
@dasdom。好方法通知我.. :-) – Antony