Timer Change Button title flashing

Source: Internet
Author: User

In a project, use the UIButton to set the countdown to receive SMS verification code, but use Nstimer to set the title will appear continuous flashing problem.

After testing found the content, if it is only a separate setting button Titlelabel content will not show the effect, if you set the title and the status of this
The problem of continuous flashing after using the Nstimer mode

When you need to use two methods at the same time, there will be no flicker problem, that is, both set

_getcodebutton.titlelabel.text = [NSString stringwithformat:@ "acquires%ds again", _second];

[_getcodebutton settitle:[nsstring stringwithformat:@ "Get%ds Again", _second] forstate:uicontrolstatenormal];

Timer Change Button title flashing

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.