0

尝试了以下属性,但没有像我需要的那样工作:

this.TableView.ContentInset this.TableView.ContentOffset

基本上,我在 uitableviewcontroller 的最顶部有图像标题,所以当 tableview 被填充时,标题图像被单元格覆盖......请看图像

在此处输入图像描述

最后,我想将单元格向下移动一点,以便为标题图像留出空间。


更新 :

添加了这段代码并以某种方式工作

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

在此处输入图像描述

但是图像被拉长了

4

1 回答 1

1

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

于 2012-10-24T21:15:56.820 回答