How do i stop text in a label from moving/changing size (being dynamic) when it has numbers that are changing every second.
var duration = //user input
func counting() {
label.text = "\(duration)"
if duration > 0 {
duration -= 1
} else if duration == 0 {
//stop
}
The functions updates itself every second.
I have an label that have numbers counting down every second, but when it changes numbers the width changes to depending on how big the number is. How do i stop this and give every letter/number the same width. So i want an "1" to take as much space as an "5". I am not talking about the space between (margin) but rather the space inside (item/letter/number size).
After checking out monospaced fonts after a tip from @Yuri i have found a solution.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.