2010-11-20 33 views
0

因此,我已經將界面生成器中的UIImage拖放到視圖上,並從下拉列表中選擇了我的PNG,這很好用,但是如果我想根據此行中的行數更改uiimage的可見性表的代碼:以編程方式設置uiimage的可見性

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 
id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsController sections] objectAtIndex:section]; 
return [sectionInfo numberOfObjects]; 

}

將我必須聲明的UIImage作爲出口和如何將我在上面的代碼進行編碼的可視性如果表中的行的數目是更一個1(即。有行存在)

回答

1

如果你想這樣做只是基於部分的行數,你就應該能夠做到這樣的事情:

-(NSInteger)tableView: (UITableView *)tableView numberOfRowsInSection:(NSInteger) section { 
     if(section == "whatever number you want to base the visibility off of") 
      imageView.hidden = YES; 
} 

凡ImageView的是,是的UIImageView在頁面上。

1

試試我們荷蘭國際集團

imageView.hidden = YES; 
相關問題