var cancelBtn = new UIButton();
cancelBtn.SetTitle("Cancel", UIControlState.Normal);
cancelBtn.Layer.CornerRadius = 5;
cancelBtn.Frame = new CGRect(200, 65,200, 30);
cancelBtn.Layer.BackgroundColor = UIColor.Orange.CGColor;
cancelBtn.SizeToFit();
这是我尝试增加按钮的宽度和高度的代码。