问题描述:

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 (e.g. viewDidLoad). Do it in, say, viewDidLayoutSubviews.

网友答案:

Try This

Make Clip Subviews checked

Hope this helps

相关阅读:
Top