AssistoLab / DropDown

A Material Design drop down for iOS
MIT License
2.44k stars 622 forks source link

How to set border color and border width #245

Open SherifKamalSalem opened 4 years ago

HajarElkoumikhi commented 4 years ago

Hello, I'm using a UIButton for my DropDown and here is how I set the border width and color : @IBOutlet weak var myButton: UIButton!

self.myButton.layer.borderWidth = 2
self.myButton.layer.borderColor = UIColor.black.cgColor
self.myButton.layer.cornerRadius = 1

`

Hope it can help ! ^^

ToqeerAhmad commented 2 years ago

You can access what tableConatinerView from subviews and before showing the dropdown set the border it works fine dropDown.subviews[1].borderWidth = 1 dropDown.subviews[1].borderColor = .black

chirag05k commented 2 years ago

For the exact requirements, I have integrated the dropdown border functionality

Integration:

 pod 'DropDown', :git => 'https://github.com/snappymob/DropDown.git', :commit => 
   '57027168178b77a9463814fbeb6cda173f301854'

Uses:

dropDown.borderColor = UIColor.gray.cgColor
dropDown.borderWidth = 1.0

Ref: https://github.com/snappymob/DropDown/commit/57027168178b77a9463814fbeb6cda173f301854

chirag05k commented 2 years ago

https://github.com/AssistoLab/DropDown/pull/265#issuecomment-1231261499