1
我有一个按钮,我在界面构建器中创建突出显示整个按钮的按钮。我没有在代码中做任何事情,只需按Ctrl +拖动到我的视图控制器文件。Xcode - 按钮突出显示不一致
然后我还有一个按钮,我这个代码编程方式创建。
let goToButton = UIButton()
goToButton.setTitleColor(UIColor.blackColor(), forState: .Normal)
goToButton.titleLabel?.font = UIFont(name: "Arial", size: 18)
goToButton.setTitle("◀︎ Go To Form", forState: .Normal)
goToButton.backgroundColor = UIColor.whiteColor()
goToButton.showsTouchWhenHighlighted = true // Should highlight entire button?
但是看起来像这样。
我怎样才能让这个像从界面生成器按钮
检查 –
您的按钮式GOTOBUTTON =的UIButton(类型:UIButtonType.System)您是否尝试过不使用showsTouchWhenHighlighted可能工作 –
? – Kevin