Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to give border color to UIButton in objc and Swift.

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 9.28k
    Comment on it

    To give border color to UIButton :-

    1. Take UIButton as property .

    2. Give corner radius and corner width to UIButton.

    3. Now give border color to UIButton.

    For Swift use :-

    demoButton.backgroundColor = UIColor.clearColor()
    demoButton.layer.cornerRadius = 5
    demoButton.layer.borderWidth = 1
    demoButton.layer.borderColor = UIColor(red: 74/255, green: 218/255, blue: 163/225, alpha: 1).CGColor

    For Objc use :-

    self.demoButton.layer.borderWidth = 1;
    self.demoButton.layer.borderColor = [UIColor whiteColor].CGColor;
    self.demoButton.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.3];    self.demoButton.layer.cornerRadius = 3.0;

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: