【发布时间】:2018-12-15 13:08:08
【问题描述】:
我正在创建一个应用程序,我在其中以编程方式创建了一个按钮,但是当在其他设备(如 iphone8、7 等)中查看时,我遇到的问题是该按钮无法完美显示在中心...它显示在 iphone X 上完美显示。如何在所有设备上完美显示我的按钮?
这是我的代码:
let button = RideRequestButton()
let dropoffLocation = CLLocation(latitude: 37.6213129, longitude: -122.3789554)
let builder = RideParametersBuilder()
builder.dropoffLocation = dropoffLocation
builder.dropoffNickname = "Your Dropoff Location"
button.rideParameters = builder.build()
button.center = view.center
view.addSubview(button)
【问题讨论】:
标签: ios swift uibutton autolayout