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