Image view with table view in the same view controller?

To have a logo type view you either need to set a custom headerview for the tableview via.

To have a logo type view you either need to set a custom headerview for the tableview via - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section; and - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section; the other method would be overriding -loadView and creating your own view that has two subviews, your imageview and a tableview. In the first method, once your scroll some the logo will eventually disappear. The second method makes the logo static.

Thank you for your answer, it help me. – JAHelia Nov 27 at 10:02.

2 options: 1. Create a UIViewController to hold your UITableViewController controller view and your imageView, then position their frame so they won't overlap 2. Add the imageView as a TableView Section Header -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UIImageView* imageView = UIImageView alloc initWithImage: UIImage imageWithContentsOfFile:NSBundle mainBundle pathForResource:@"image" ofType:@"png"; return imageView; } and make sure you have at least 1 section of course in: - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections.

Return 1; }.

NumberOfSectionsInTableView: is optional. An implementation that returns 1 is redundant as a table view will have one section by default. It may be good to implement it anyway for completeness, but you do not need it.

– hypercrypt Nov 27 at 9:46.

If so then you can, in -viewDidLoad, set the tableView's tableHeaderView to the view you want, e.g. : tableView. TableHeaderView = UIImageView alloc initWithImage:UIImage imageNamed:@"image"; // assuming ARC, else autorelease or put in variable first... If you want it to float on top when scrolling then DanZimm's use of -tableView:viewForHeaderInSection: is what you want.

Try adding it in: - (void)viewDidAppear:(BOOL)animated This method is only called once you have called viewDidLoad so if you want something over everything else you might call this one or add the subview to: UIApplication sharedApplication keyWindow addSubview:yourView; Hopefully it helps you.

I believe he means that he wants the tableview to not be scrolling underneath of the image, not that the image isn't actually the top most view. He says that the imageview is on "top" of the cells but the cells are able to scroll underneath the imageview – DanZimm Nov 27 at 8:51 If you do this in -viewDidAppear: then you need to be careful that you only call it once as -viewDidAppear: can be called multiple times if the view controller is presented and dismissed. – hypercrypt Nov 27 at 8:58 Damn right @hypercrypt forgot to add that!

– El Developer Nov 27 at 9:08.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions