Giter VIP home page Giter VIP logo

Comments (5)

andresteves avatar andresteves commented on August 17, 2024 1

Thank you for the code @Minitour.

For future reference replace

tableView.topAnchor.constraint(equalTo: container.topAnchor).isActive = tableView.bottomAnchor.constraint(equalTo: container.bottomAnchor).isActive = true

with

tableView.topAnchor.constraint(equalTo: container.topAnchor).isActive = true
tableView.bottomAnchor.constraint(equalTo: container.bottomAnchor).isActive = true

from azdialogviewcontroller.

Minitour avatar Minitour commented on August 17, 2024

@andresteves Hi, can you please show me the code that you tried?

from azdialogviewcontroller.

andresteves avatar andresteves commented on August 17, 2024

Hi @Minitour

I tried the master branch with the readme custom code but some variables don't exist anymore.
So I tried to add a custom view to the existing stackview but with no success... Just displays a massive button.

from azdialogviewcontroller.

Minitour avatar Minitour commented on August 17, 2024

@andresteves
Here is how you properly add a custom view:

//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.

from azdialogviewcontroller.

andresteves avatar andresteves commented on August 17, 2024

For some reason the pod I had was version 1.0.2 which does not have that code..

from azdialogviewcontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.