2010-11-20 9 views
0

私はインターフェイスビルダーのUIImageをビューにドラッグしてドロップダウンからPNGを選択しましたが、これはうまくいきますが、これで行の数に応じてuiimageの表示を変更したい場合表コード:programatically uiimageのvisibiltyを設定します

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

}

iは出口としてuiimageを宣言すると、テーブル内の行の数がより多く、1であればどのように上記のコードでの視認性をコーディングなるだろう(すなわち。行があります)

答えて

1

をINGのページ上に

1

お試しくださいImageViewのはUIImageViewは

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

です:あなたは単にあなたがちょうどこのような何かを行うことができるはずセクション内の行数に基づいて、それを実行したい場合は

imageView.hidden = YES; 
関連する問題