Reputation: 71
Tried below properties but didn't work like I need :
this.TableView.ContentInset this.TableView.ContentOffset
Basically, I have image header at the very top of the uitableviewcontroller , so when tableview gets populated , header image is laid over by cells ...plz look at the image
Eventually, I want to shift cells a little down to leave room for the title image.
update :
added this code and somehow worked
UIImageView img = new UIImageView (new RectangleF ((this.View.Bounds.Width- 164)/2,0, 164, 44));
img.Image = UIImage.FromFile ("Images/app-name.png");
this.TableView.TableHeaderView(img);
but the image is stretched out
Upvotes: 0
Views: 236
Reputation: 3896
Add your image in table header tableHeaderView
.
Also, set custom height to the table header - sectionHeaderHeight:
Note: these are UITableView class's properties. I am not sure about Monotouch but you might be able to find some similar properties in it.
Please try any of the following:
Refer to this answer and its comments: Adding an image to a Section in Monotouch.Dialog
HeaderView = new UIImageView (UIImage.FromFile ("imagename.png"))
Or refer to this : http://dantes-andreea.blogspot.com.au/2011/08/monotouch-class-for-resize-maintaining.html
Try this : iphone: put uiimage in tableview section header, stretch problem
Upvotes: 1