开发者

changing image dynamically in iPhone application

My problem is, I have table of names. And when I touch on each name, a开发者_StackOverflow中文版 new view should appear and image of corresponding name. For all the names only one view should be there and the image should change dynamically.

Thank You.


If you have a view controller with an UIImageView. Then I'd make the UIImageView a property:

@property (nonatomic, retain) UIImageView *myImageView;

Then in the didSelectCellAtIndexPath method for the tableview delegate, you set the image property to the image view depending on the cell selected.

myViewController.myImageView.image = [UIImage imageNamed:@"myImageName"];


Read Navigating a Data Hierarchy with Table Views in the Apple docs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜