iOS 6 autolayout scrollview not scrolling with two tables - ios6

I have a scrollview with two tableviews side by side, and a bottom navigation bar.
Both tableviews should consume the entirety of the view, but scroll together if their content is too large for the screen. The two tableviews show different data of the same dataset.
When the table content is larger than the screen, or I rotate the phone to landscape, then there's no scrolling. There doesn't appear to be any scrolling at all.
I'm trying to stick with autolayout. What am I doing wrong here? The tableviews are sized to be the entire size of the view, and navigation bar is set to be 0 away from the bottom of the view. It sticks correctly, but scrolling doesn't work at all.
What am I supposed to do to get scrolling working?

UITableView is itself a UIScrollView - which means that if its interior content is larger than its size it will scroll. I've had to deal with table views inside scroll views before and I think that turning off scrolling does not force the table view to be the height of its interior content, but instead it clips it to the visible area. To get a table view to fit the interior content, you need to add a height constraint to the table view and drag it into your controller to create an outlet. Then in your controller add something like this (updated to match your constraint outlet names)
-(void) viewWillLayoutSubviews{
[self.tableViewOne layoutIfNeeded];
self.tableViewOneHeightConstraint.constant = self.tableViewOne.contentSize.height;
[self.tableViewTwo layoutIfNeeded];
self.tableViewTwoHeightConstraint.constant = self.tableViewTwo.contentSize.height;
}
Make sure that you have constraints from the bottom of your table views to the scroll view too, so that your main scroll view knows to fit the interior content.

Related

Inverted react-beautiful-dnd order

I have a working vertical column drag and drop React app using react-beautiful-dnd, but would like to 'invert' it so that Draggable items fall to the bottom of the Droppable div instead of floating to the top. Is this possible?
If I'm understanding you correctly, you'd like to have a list where when the container is not full, the items within that list are aligned to the bottom of the container?
If so, then yes - I would utilize flexbox.
Here is a good resource for flex - https://css-tricks.com/snippets/css/a-guide-to-flexbox/
There are multiple different ways to implement this with flex. Pick your poison.
edit
Based on the code sandbox:
I would add a wrapper div to the bay component with the same height as what you have now. On the child div, add a dynamic height field that is dependent on how many tables the bay contains.
Users won't be able to drop into the entire column but you could style it to show the user where they need to drop when the column is empty.
I ended up just creating another invisible strip with flexGrow = 1 to push everything to the bottom.

Follow up on: Rebuild list of containers without scrolling the list

Referring to this question and answer by Shai Almog:
Rebuild list of containers without scrolling the list
I have a form with one container (TableLayout), which contains several rows with labels and buttons. Clicking a button changes the order of the rows and rebuilds the whole form (after myForm.removeAll() ). After myForm.revalidate() the form jumps to the top.
I am trying to implement this exact behaviour, to return to the same point (scroll position Y) after revalidating/changing the container contents.
I subclassed the Container-class to make setScrollY(int) visible. Using this with an arbitrary value does not scroll to the position, so it seems that the setScrollY method is not changing the scroll position of the content pane overall.
And myContainer.getScrollY() always returns "0". I only get the scroll position by calling getContentPane().getScrollY().
But it is obviously not possible to call the setScrollY()-method on the content pane - as it is not possible to subclass the content pane - to scroll back to the same position after revalidating the form.
Thanks for any advice!
Use border layout which disables the scrolling of the form/content pane.
Place your container (where you exposed setScroll) in the center and make sure to invoke setScrollableY(true) on that Container.

Polymer grid in different views

I'm not sure if this is the right place to ask because I dont have any code to show. I'm actually looking for ideas on possible ways to solve my problem.
I have an app that displays the grid on the screen when the media query has a min width of a tablet.
But when the view is in mobile mode I don't want to show the grid. Instead I have a drop down menu which has a grid option. When selected will be show in a paper-dialog (pop up)
The problem is I have to create two grids (vaadin-grid) and show the appropriate one based on the view. Is there a way to have only one grid? Can I put it in a paper-dialog but not pop-out when in tablet and desktop view?
Thanks in advance
If your grid element has every custom property then that is an element in the DOM, so you can move it into the dialog if thats needed using javascript:
let myGrid = this.$$('#myGrid');
let myDialogContent = this.$$('#myDialogContent');
Polymer.dom(myDialogContent).appendChild(myGrid);
Also if you think it a different way, then you can hide the grid outside of the screen and you can slide that in when it's needed like a drawer panel and you dont need to move the element at all in the DOM.
By the way for programming question stackoverflow has the https://softwareengineering.stackexchange.com/ site, but I think it is Ok to send it here.

How can I reduce the padding on a Dialog?

When I press a button, my app displays a calendar (within a Dialog) that slides from the bottom of the screen:
I want the Calendar to occupy the whole width of the screen, but it shows some white padding on both sides and also on the top and bottom (It is white because the "Dialog" UIID has a white created image as background)
I have tried changing all the UIID related to Dialog: "Dialog", "DialogBody", "DialogTitle", etc. I set all margins and paddings to cero.
How can I get rid of that padding?
Try change both the DialogUIID and the UIID of the dialog. Also make sure your calendars margin values are set to zero. It could be that your calendar is too small. Try placing it in a table layout with 1 row and 1 column then in layout constraints set the width and height to 100%
Open up the Component Inspector tool and traverse the hierarchy. You will be able to see all the components and their UIID's within the hierarchy and you should be able to understand which one of those components contributes to the padding/margin.

EXTJS: scrolling issue

When Data loads in grid and scrolling appears, I can navigate it through up/down arror key. But when the pointer goes down not able to see the content in grid, i mean the grid does not shift upword automatically.
Looks like your grid is not rendered properly. Judging by your description your grid is bigger then the panel it belongs to. Please post some code and screenshots.

Resources