Resizing Table Width in MonoTouch.Dialog

隐身守侯 提交于 2019-12-24 12:07:55

问题


I would like to override the table width that is given to MonoTouch.Dialog's tables by default.


回答1:


You can't do this, because it uses UITableView/UITableViewController which have some special features to take up the width of the parent view. What you can do is make a UIView to act as a "container" that is sized to the height and width you want, then add the TableView as a subview to that. Now the DialogViewController's TableView will size to your container.

Note* Container is then added as a subview to your controllers View.

container = new UIView(frameSize);
dvc = new DialogViewController(...);
container.AddSubview(dvc.TableView);
View.AddSubview(container);


来源:https://stackoverflow.com/questions/17572247/resizing-table-width-in-monotouch-dialog

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!