答案 0 :(得分:0)
let kg = UILabel(frame: CGRectMake(0,0, 10,10))
kg.font = UIFont(name: "Helvetica Neue", size: 23)
kg.text = "kg"
kg.sizeToFit()
kg.frame = CGRectMake(pickerView.bounds.width / 4 + kg.bounds.width, pickerView.bounds.height / 2 - (kg.bounds.width / 2) ,kg.bounds.width,kg.bounds.height)
pickerView.addSubview(kg)
答案 1 :(得分:0)
所以我通过在选择器视图中放置一个标签并在界面构建器中以自动布局为中心来解决。