我想在我的View中添加一个无边框的UIButton。使用界面生成器,我通过从对象库中拖动一个RoundRectButton来完成此操作。然后,在属性检查器上,将类型更改为自定义并将标题保留为“按钮”。界面生成器一切正常。但是,程序化方法并非如此。以编程方式,我是这样做的:UIButton*button=[UIButtonbuttonWithType:UIButtonTypeCustom];[buttonsetFrame:CGRectMake(x,y,width,height)];[buttonsetTitle:@"Button"forState:UIControlStateNorma