Comments (6)
Please try
class CustomPopoverTableViewController: PopoverTableViewController {
override public var preferredContentSize: CGSize {
get {
return CGSize(width: 250, height: 250)
}
set {
super.preferredContentSize = newValue
}
}
override func viewDidLoad() {
super.viewDidLoad()
tableView.isScrollEnabled = true
}
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 100
}
}
And then exchange the PopoverTableViewController with CustomPopoverTableViewController
from popoverkit.
The height of PopoverTableViewController is depending on preferredContentSize which is calculated by rows of tableview
from popoverkit.
Please check the below screen shots for iPhone & iPad of popovercontroller. In iPad list is cropped and tableView is not scrolling.
P.S. I am using the same TableView that is in the demo that you have provided with same model data structure.
and for row height I am doing below code
public override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return DeviceType.isIPad() ? 50 : 40
}
If i Change the height from here then popover tableView row height will be changed as expected but the Popover Height is not changed and it cropped the options in Popover.
from popoverkit.
I have checked out, I didn't find any problem, sorry. If you really want to change the height of popover, you can inherit PopoverTableViewController, and override preferredContentSize and heightForRow. Finally if there has any problem, you can send me demo using email.
from popoverkit.
Please check the Repo.
I have tried this below line to change the contentsize but there is no effect (for dummy check).
vc.preferredContentSize = CGSize(width: 250, height: 500)
I have observed one more thing, if I removed heightForRowAt
then all titles are shown perfectly and popOver kit width & height will be based on the title size.
I want popover kit size different in iPhone and iPad.
from popoverkit.
Please try
class CustomPopoverTableViewController: PopoverTableViewController { override public var preferredContentSize: CGSize { get { return CGSize(width: 250, height: 250) } set { super.preferredContentSize = newValue } } override func viewDidLoad() { super.viewDidLoad() tableView.isScrollEnabled = true } override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return 100 } }And then exchange the PopoverTableViewController with CustomPopoverTableViewController
Working as expected , Thanks
from popoverkit.
Related Issues (4)
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 popoverkit.