-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No custom view support #11
Comments
@andresteves Hi, can you please show me the code that you tried? |
Hi @Minitour I tried the master branch with the readme custom code but some variables don't exist anymore. |
@andresteves //create the dialog object
let dialog = AZDialogViewController(title: "TableView Dialog", message: nil)
//make a ref to the container (the container where you place your custom views)
let container = dialog.container
//set a height for the container using a ratio. The ratio that is given describes how the height should
//be treated in respect to the width of the dialog. so in example "1.0" will result in a square container.
//A ratio of 0.2 means that the height of the container is 20% of the width of the dialog.
//The default value is "0.0" - which means hidden
dialog.customViewSizeRatio = 1.0
//add your custom views
let tableView = UITableView(frame: .zero, style: .plain)
container.addSubview(tableView)
/*
Do any additional setup to the view if you wish.
*/
//Add constraints; This step is very important.
/*
Visual representation of the constraints we are adding:
H: |-(0)-[tableView]-(0)-|
V: |-(0)-[tableView]-(0)-|
*/
tableView.translatesAutoresizingMaskIntoConstraints = false
tableView.topAnchor.constraint(equalTo: container.topAnchor).isActive = true
tableView.bottomAnchor.constraint(equalTo: container.bottomAnchor).isActive = true
tableView.leftAnchor.constraint(equalTo: container.leftAnchor).isActive = true
tableView.rightAnchor.constraint(equalTo: container.rightAnchor).isActive = true
//finally when ready, show the dialog
dialog.show(in: self) If you are still unable to get it to work let me know. |
For some reason the pod I had was version 1.0.2 which does not have that code.. |
Thank you for the code @Minitour. For future reference replace
with
|
Hi,
It seems there is no support for adding a custom view...
I tried to add a custom view within the code but it does not show anything.
Regards,
Andre
The text was updated successfully, but these errors were encountered: