我想查詢圖像在我的UITableview
,但我在嘗試配置單元時遇到問題。查詢圖像到UITableView
回答
創建UITableViewCell
的子類並向其添加UIImageView
屬性。下面是你的頭文件是什麼樣子的例子:
#import <UIKit/UIKit.h>
@interface CustomTableViewCell : UITableViewCell
@property (nonatomic, weak) IBOutlet UIImageView *icon;
//@property (nonatomic, strong) UIImageView *icon; //Only if you're not using an XIB/storyboard
@end
然後,你cellForRowAtIndexPath:
功能將類似於這樣:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *[email protected]"cellimage";
CustomTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
//the following assumes that your self.images array contains UIImages
cell.icon.image = [self.images objectAtIndex:indexPath.row];
return cell;
}
此外,一定要打電話reloadData
的主線程。
但是我應該把什麼放在UIImage * yourImage – 2014-09-25 04:59:22
無論你的圖像是什麼。你如何從你的'PFObject'獲得你的圖像? – rebello95 2014-09-25 05:00:24
可以在你的代碼中加個例子 – 2014-09-25 05:01:32
- 1. UitableView圖像到全屏
- 2. 添加圖像到uitableview cell
- 3. UITableView /細胞查詢 - 如何獲得像iStudiez表視圖?
- 4. UITableView的圖像
- 5. UPDATE查詢圖像
- 6. UITableView刷新查詢
- 7. 更新查詢到的圖像
- 8. SQL查詢圖像列到文件
- 9. 浮動UITableView圖像?
- 10. uitableview重複圖像
- 11. UItableview中的圖像
- 12. 試圖從查詢加載解析PFFiles到UITableView
- 13. IOS優化加載圖像到UITableView
- 14. SIMPLE切換圖像查詢
- 15. 圖像和文本查詢
- 16. CSS背景圖像查詢
- 17. xpath查詢圖像url
- 18. inRange查詢圖像輸出
- 19. 從SalesForce查詢圖像blob
- 20. UITableView SearchBar過濾查詢
- 21. 相似到MySQL像「%%」查詢
- 22. UITableView的背景圖像 - iOS
- 23. 帶圖像的動態UITableView
- 24. 設計UITableView背景圖像
- 25. UITableView圖像導致崩潰
- 26. 在UITableview中顯示圖像
- 27. 用圖像加載UITableView?
- 28. UITableView造成圖像放大
- 29. UITableView覆蓋/隱藏圖像?
- 30. HJCache UITableView重疊圖像
您需要在主線程上重新加載表,而不是後臺線程。 – rmaddy 2014-09-25 04:53:06