Pirate
Pirate

Reputation: 71

decrease height of UITableViewController [monotouch if possible]

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

enter image description here

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);

enter image description here

but the image is stretched out

Upvotes: 0

Views: 236

Answers (1)

user427969
user427969

Reputation: 3896

Add your image in table header tableHeaderView.

Also, set custom height to the table header - sectionHeaderHeight:

http://developer.apple.com/library/ios/#documentation/uikit/reference/UITableView_Class/Reference/Reference.html

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

Related Questions