Autoresizing not working in iOS11 / XCode 9 - autolayout

It appears that the Autoresizing of views is no longer reliably working when building for iOS11 with XCode 9.
The layout of several views end up with the positioning of controls as they are in the XIB, but the appropriate resizing has not happened. This has been working fine in iOS10, and works with our old app running in iOS11. However, rebuilding the app the positioning and sizing fails.
Has something changed that impacts the use of autoresizingmask?
Is there a way to automatically convert from AutoResizing to AutoLayout and Constraints?
Edit:
The controls that are giving trouble are the UINavigationBar and UIToolBar.

I'm working on this same issue today: one thing that has worked in some cases is swapping out for similar (but not identical) mask values. For example, one of our views didn't work with UIViewAutoresizingFlexibleHeight but it works with UIViewAutoresizingFlexibleBottomMargin.
I'm not aware of an automatic way to upgrade to AutoLayout - I actually use AutoLayout a lot in other projects, and the conceptual basis is pretty different...
I'll edit this answer if I find anything better.

Same issue here. As mentioned by #John Nimis playing with masks sometime seems to solve the problem. For example, when we had both top and bottom masks (UIViewAutoresizingFlexibleTopMargin| UIViewAutoresizingFlexibleBottomMargin) we got success removing the Top one.
EDIT
I don't know if this is a definitive solution, but I noticed everywhere the issue happened I had a fixed origin (x or y) on the frame. For example:
view.frame=(view1.frame.origin.x, 150, width, height);
Changing the fixed value in a relative value (for example respect to another view1) solved the issue with masks:
view.frame=(view1.frame.origin.x, view1.frame.origin.y+view1.frame.size.height+20, width, height);

Related

What can I use to represent data?

I'm doing a project at work where I'm taking the value of 8 sliders, running the values through a formula, then displaying that value on the screen. I would like to accompany with a type of vertical graph/bar that will span a grid. I tried using progress bars, which I ran into issues with both expanding the progress bar to the height of the grid, and displaying the value once the value went backwards. I had the same layout issues with the slider, once rotated -90 degrees the slider won't expand the height of the grid. Does anyone have any suggestions on what I could try or and objects that I haven't thought of?
I've been happy using Syncfusion to chart data in Xamarin.Forms. It sets up fast and comes with lots of friendly defaults so you can see right away whether it's working. Link to Syncfusion. If you want to see it used for real I'm using it in my app over here.
It sounds like from your question and the comments that while you're intent on charting data you're also very set on using a Grid to do something. From many experiences I've had in the past I would warn you to be careful about blaming the graphing/charting/drawing library for things going haywire when the problem could very well be that you are using the wrong layout or using it in the wrong way.

DataTables Responsive Plugin Overflow on small screens

I'm having an issue with the Responsive plugin for DataTables (version 1.10.4) which can be seen in the provided image. I'm currently trying to get this to display correctly on phones where the screen is small. The issue happens when the columns become small enough that they cannot be shrunk anymore. Instead of Responsive automatically hiding the column it leaves it visible until most of the column overflows before hiding it.
It seems to ignore the containing div width and instead only cares about the window size. It does work correctly for some tables (the widths just happen to line up correctly so Responsive hides all the correct columns)
I don't 'think' this is a custom CSS issue but I may be wrong. Any ideas on a fix or what I could do to troubleshoot this issue?
Updating DataTables to a newer version is possible but not ideal (lots of tables are using retired plugins and would require a lot of modifications)
Thanks
I finally found my issue. Big thanks to the posts at https://github.com/DataTables/Responsive/issues/20 for pointing me in the right direction.
The version of response I was using was 1.0.2 and the bug appears to have been fixed in 1.0.4.
Ended up upgrading DataTables to the newest version (1.10.4 to 1.10.10) and adding in the newest versions of the two 'retired' plugins TableTools and ColVis which seem to work just fine so I didn't need to do a ton of refactoring.
https://www.datatables.net/download/packages

Overcome z-index stacking

I've been experimenting with this for over a week and I'm about to give up, as I think this is not possible, but I wanted to reach out to this awesome community first.
What I'm trying to achieve is to, somehow, overcome the stacked z-index settings.
Let me show you an example so you maybe get the idea faster:
http://raulmellado.com/clientes/zindextest/
What I'd like is to have the green div (#shouldbeontop) on top of all elements (I am setting it to position:fixed).
In other responses in stackoverflow (yes I've read dozens of threads here), the answer is to change the html, move elements around, etc, but my problem is that I'm creating the #shouldbeontop and #scrollbar elements dynamically using js (my application is a bit more complex than this example, but I've tried to simplify to share my problem here).
I've created a js that can be embedded (ideally) on any webpage which will add the elements, so I can use js if needed, but I can just assume that the #shouldbeontop and #scrollbar elements will be there; the rest could be any html/css combination that's already there.
Usually, where there is no z-index in different divs, this works beautifully, but as soon as there is some stacking, it breaks :-(
If you would like to see a real life application of this, here you can find a quick & dirty demo: http://videngage.me/demo/demo1.html (here there is no z-index, so the video [#shouldbeontop in my simplified demo] is always shown on top (when you scroll down), but here http://www.members.skolahudbyonline.eu/rytmus-trening-majstra/ the video goes behind when you scroll down)
Is there an universal solution for this (using css and/or js), or should I just give up?
Thanks sooooooooo much for your help

NSOutlineView and Autolayout

Having recently switched to autolayout in Xcode 5 (and having watched the developer video from WWDC 13), I'm finding things to work pretty well with the exception of a View-Based NSOutlineView.
Before autolayout, this worked. Everything works fine and is in the right location, but now, specifically when I scroll, some of the new entries (and not all of them) end up in the wrong place, always larger and slightly higher.
The problem goes away once they are redrawn, but I don't understand the mechanic for drawing these NSTableCellViews and when they are created by the Outline View. I mean, it looks like they are created at some point, the program is guessing about the proper constraints, and then fixing them after a redraw.
It would be really nice to post an image to explain this, but can someone explain the life cycle of a view in an NSTableView or NSOutlineView?
I had to grapple with that issue myself and I was able to fix it today. This will happen if you are using any content inside an NSTableCellView that needs to be resized to fit into its cell or any subview of it. I fixed this problem by using an NSImage with the exact same size as a placeholder NSImage I added as subview to the NSTableCellView on IB. This resizing will break the constraints you added to or expect in this view.

Flex: vmode=opaque

I'm using http://code.google.com/p/flex-iframe/ for showing html in an flex application. To set this up I need to set vmode=opaque. But doing this messes with keyboardinput (at least a swedish charlayout) in Firefox. For example a press on the array key resolves in two arrow chars/steps. If I remove vmode=opaque it works again.
There have historically been lots of issues with setting wmode to opaque. I've had similar issues in the past and had to resort to removing this wmode setting. However, if you're so inclined you could hackishly detect the presence of two keyboard input events within a relatively short time period and suppress one of them. It's not a really elegant solution but if you cannot get rid of wmode, it might be a viable workaround until the bug is fixed by adobe.

Resources