Comments (5)
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.
@andresteves Hi, can you please show me the code that you tried?
from azdialogviewcontroller.
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.
@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.
For some reason the pod I had was version 1.0.2 which does not have that code..
from azdialogviewcontroller.
Related Issues (20)
- Unable to customize UIButton. HOT 3
- Change font of title and message labels HOT 1
- Is there a way to increase the width of button? HOT 1
- Is there a way to know when dismiss() on the dialog is called? HOT 3
- Change font size? HOT 14
- Dialog inside a popover HOT 2
- Delegate ? HOT 1
- Re-Call Bug HOT 4
- @ObjC HOT 2
- iPhone XS Max support? HOT 4
- Feature request: app-wide customization HOT 1
- Windows are too small on iPad HOT 4
- Can I add a tableView inside the DialogController? HOT 1
- Dialog appears a-lot smaller on IPhone X HOT 1
- set leftToolItem.heightAnchor.constraint in accordance to rightToolItem.heightAnchor.constraint
- Override height for calculations? HOT 2
- Image view holder should have the alert's background color
- Add dark theme support
- How to show dialog from top? HOT 2
- Issue when Dismissing HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azdialogviewcontroller.