I am setting the corner radius of UIButton
as follows:
self.btnFBLogin.layer.cornerRadius = self.btnFBLogin.frame.size.height/2;
self.btnFBLogin.layer.masksToBounds = YES;
However, after upgrading to Xcode 8 it is not working. Button is not displayed in screen. However, if I do not set the corner radius it displays as a square box. Has anybody faced similar issue?
In all probability you are running that code too soon (eg viewDidLoad
). Do it in, say, viewDidLayoutSubviews
.
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.