AssistoLab / DropDown

A Material Design drop down for iOS
MIT License
2.43k stars 623 forks source link

Full width Seperator line #300

Open mc-lctoan opened 2 years ago

mc-lctoan commented 2 years ago

IMG_0074

I want to add a separator line between the items. but a part of the line is hidden.

How can I get the separator line with full width of the dropdown?

MrPrakashR commented 1 year ago

I able to add full width line with below code:

memberDropDown.customCellConfiguration = { (index: Index, item: String, cell: DropDownCell) -> Void in let dividerLine = UIView(frame: CGRect(x: 0, y: cell.frame.height - 1, width: self.view.frame.width - 20, height: 0.6)) dividerLine.backgroundColor = UIColor().darkBlueColor cell.addSubview(dividerLine) }

thingineeer commented 10 months ago

I able to add full width line with below code:

memberDropDown.customCellConfiguration = { (index: Index, item: String, cell: DropDownCell) -> Void in let dividerLine = UIView(frame: CGRect(x: 0, y: cell.frame.height - 1, width: self.view.frame.width - 20, height: 0.6)) dividerLine.backgroundColor = UIColor().darkBlueColor cell.addSubview(dividerLine) }

@MrPrakashR

It's a good idea to fine-tune it with customCellConfiguration, but there's a very very good solution, so I'll do a PR.

If you write the code above, an issue will occur where two Separators are visible when you press DropDown twice.

image