Ios 将图像从TableView传递到UIView
我有一个tableView,我从Parse.com获取内容(一个图像、一个标题和一个描述),我使用UIView作为我的detailView。点击单元格时,UIView将显示动画。我设法得到了我的标题和事件描述,但我无法得到图像文件 如何将解析后的图像传递到UIView 谢谢 这是我的.h文件Ios 将图像从TableView传递到UIView,ios,uitableview,uiview,uiviewcontroller,parse-platform,Ios,Uitableview,Uiview,Uiviewcontroller,Parse Platform,我有一个tableView,我从Parse.com获取内容(一个图像、一个标题和一个描述),我使用UIView作为我的detailView。点击单元格时,UIView将显示动画。我设法得到了我的标题和事件描述,但我无法得到图像文件 如何将解析后的图像传递到UIView 谢谢 这是我的.h文件 #import <UIKit/UIKit.h> #import <Parse/Parse.h> #import "TableCell.h" @interface ViewContr
#import <UIKit/UIKit.h>
#import <Parse/Parse.h>
#import "TableCell.h"
@interface ViewController : UIViewController <UITableViewDelegate> {
NSArray *events;
}
@property (weak, nonatomic) IBOutlet UITableView *newsTable;
@property (strong, nonatomic) IBOutlet UIView *detailView;
@property (strong, nonatomic) IBOutlet UILabel *InfoDetailLabel;
- (IBAction)backBtn:(id)sender;
@property (strong, nonatomic) IBOutlet UILabel *viewTitle;
还有我的手机
#import <UIKit/UIKit.h>
#import <Parse/Parse.h>
@interface TableCell : UITableViewCell
@property (strong, nonatomic) IBOutlet UILabel *TitleLabel;
@property (strong, nonatomic) IBOutlet UILabel *DescriptionLabel;
@property (strong, nonatomic) IBOutlet PFImageView *imageView;
@end
#导入
#进口
@接口TableCell:UITableViewCell
@性质(强,非原子)IBUILabel*标题标签;
@属性(强,非原子)IBUILabel*DescriptionLabel;
@属性(强,非原子)IBMImageView*imageView;
@结束
试试看
或者您可以使用与
loadInBackground:
在cellForRow
中使用的方法相同的detailView
也可以使用@user3499983是否设置cell.imageView.image=img代码>位于单元格中的行索引路径:
?
#import <UIKit/UIKit.h>
#import <Parse/Parse.h>
@interface TableCell : UITableViewCell
@property (strong, nonatomic) IBOutlet UILabel *TitleLabel;
@property (strong, nonatomic) IBOutlet UILabel *DescriptionLabel;
@property (strong, nonatomic) IBOutlet PFImageView *imageView;
@end
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"cell tapped");
//Assuming not reordering the cells after it loaded
TableCell *cell = (TableCell *)[tableView cellForRowAtIndexPath:indexPath];
[[yourDetailView imageView] setImage:[[cell imageView] image]];
.....
}