开发者

MonoTouch.Dialog: Table appearing 5 cm from top

开发者 https://www.devze.com 2023-04-03 17:11 出处:网络
I\'d like the UITableView which MonoTouch.Dialog creates to appear 5cm or so from the top of the screen. By default it\'s at the top.

I'd like the UITableView which MonoTouch.Dialog creates to appear 5cm or so from the top of the screen. By default it's at the top.

Is there an easy way to put in a top marg开发者_如何学Goin?


The simplest way of adding this padding is to take advantage of the Section headers and footers. This requires the use of the Elements API instead of the Reflection one.

You need to pass a view as your header, for example:

// Create a view that is 200 points tall
var myMargin = new UIView (new RectangleF (0, 0, 1, 200));

var mySection = new Section (myMargin);

Then add your elements to that section.

0

精彩评论

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

关注公众号