0
我試圖覆蓋在聊天細胞表演圖像(UICollectionView細胞)隨機三個點按鈕
不過,我注意到有這樣的效果每個圖片我使用。以下是我正在構建的按鈕的代碼。
let playButton: UIButton = {
let button = UIButton(type: .system)
button.setTitle("Play Video", for: .normal)
button.translatesAutoresizingMaskIntoConstraints = false
button.isUserInteractionEnabled = true
let image = UIImage(named: "play")
button.tintColor = UIColor.white
button.setImage(image, for: .normal)
return button
}()
這就是它看起來像在模擬器:
爲什麼我的UIImage的追加這些點?
刪除UIButton的setTitle,因爲您不需要爲Play Image顯示文本。 –
它是按鈕的標題,從'playButton'中刪除這行代碼'button.setTitle(「播放視頻」,用於:.normal)'@Ricky Avina –