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
JBLineChartView: wrong width on iPhone6/6+ #177
Comments
I'm guessing the width of the chart is incorrect when it's displayed the first time. As an experiment, keep an instance around of the chart and call reloadData on viewDidAppear of your table controller. See what happens... |
Unfortunately I can't because the big cell with the chart is made visible only after I select some row :-( |
I've created a small sample which demonstrates the problem: https://dl.dropboxusercontent.com/u/102474509/ChartCellTest.zip |
AL constraints are set correctly, so it should work. |
Print out the chart's frame on reloadData and it's grabbing 600. Subsequent call have it set to 375. The chart is doing it's thing, it's just that reloadData is being called at a time where the chart's size isn't correctly set. Why is it 600 to begin with? Any way to correct this and have it equal the width of the container? |
I thought that AL should do it. |
OK finally I figured it out. I had to implement layoutSubviews:
Thanks a lot for your help. |
Isn't it |
I have JBLineChartView inside UITableViewCell which is inserted in UITableView after the touch on another UITableViewCell.
When the cell is displayed for the first time it has wrong width on iPhone6/6+. Later it look OK.
If I put ordinary UIView instead of JBLineChartView everything works fine.
Any idea what could be the reason?
Thanks.
The text was updated successfully, but these errors were encountered: