For UIViewController, we have UIModalTransitionStyle and UIModalPresentationStyle
Question is what is the difference of them ?
UIModalTransitionStyle is used to specify how the modal form transitions into view. For example, it can come in vertically, flip horizontal, or do a partial curl.
UIModalPresentationStyle is used to specified whether you want the modal form to be full screen (basically what iPhone uses) or otherwise (therefore only makes sense for iPad) as a page sheet (full height, width is the size of the portrait mode screen width), a form sheet (partial width and partial height) or current context (i.e. what the parent container uses).
Related
I am trying to show a diagram of products with the image to scale. I have the image element sized with a width and min-width set to the correct width for the image.
I have an 'resize' event listener triggering my zoom on the image element to equal a correction factor:
const ratio = (window.innerWidth / window.outerWidth)
This works acceptably except when the browser vertical sidebar is open.
I searched here and could not find a property to show me sidebar width or to accurately detect zoom level in all browsers. I can use window.devicePixelRatio but that is not working in mac safari.
Would a canvas or svg element offer me some opportunities here i don't see?
Perhaps the best is just to have a input type='range' element next to the image to allow calibration to common object such as a credit card or coin.
Am I mistaken in thinking that if my picture is correct at 600px on my machine that it can be rendered universally in the browser with css width settings?
Thanks alot for any reflections
So I built this Wordpress page using WPBakery page builder and added a Pardot form to it. On certain browser sizes the form - which looks like it is an iframe element - is larger than the container it's in, so it adds scrollbars to compensate. Is there a recommended solution to keep this from happening? See attached image:
Picture of Pardot form forcing scrollbars
If you're not entirely sure if the form is an iframe element, you could try targeting the form's fields using CSS and using dynamic width and height values such as width: 100%; instead of something like width: 250px;, which will automatically resize your elements to fit the available width. This will take care of the horizontal scrollbar.
For the vertical scrollbar, you could try targeting the scrollbar with psuedo properties to manipulate it's style or hide it altogether. You can read more about it here:
https://css-tricks.com/almanac/properties/s/scrollbar/
It's worth noting though, that this approach isn't highly recommended, due to it's limited support across different browsers and platforms.
However, in the case of this specific vertical scrollbar, it appears to be a height or padding issue on the form's container, so you could target that with #media queries to make it more responsive across devices.
I hope this helps!
The best you can do, is in Pardot, create custom CSS - in Pardot - to accommodate smaller screen sizes.
The biggest issue with this is that the screen size is iframe dependent and not actual browser window width that it's embedded in.
So if you put the iframe into a container that is 600px wide on desktop, that would be a media query of #media (min-width: 600px) in Pardot. You need to adjust the media query for the container size.
If you don't have access to Pardot's CSS tools, you're mostly out of luck.
I have a ViewController that has content in the top third and then a UIContainerView in the bottom two thirds of the view. The UIContainerView allows the user to rotate between three childViewControllers. Using AutoLayout, I have constrained the UIContainerView to the sides of the screen (widthAnchor), the bottom of the screen (bottomAnchor) and two thirds of the way up the screen (topAnchor).
In laying out content in the first childViewController, which appears on the initial load of the parent ViewController, I ran into difficulty. It appears that on that initial load, the childViewController view is given a view.frame.height equal to the height of the device. I set up my constraints to deal with that and the first screen displays fine.
The issue I am running into now is that when I rotate through the childViewControllers, the view.frame.height is set to the height of the ContainerView (which I would have suspected to be the case from the start). This causes the constraints in the first childViewController to "break".
Look at this behavior below.
Image #1: Initial load of the ParentViewController.
https://roryent.box.com/s/xhil4wk0ga5qoddhko5jxj3a1r4103h3
Image #2: Switching the childViewController.
https://roryent.box.com/s/9f2jj0l1waui3ekyplq4eae51m6wrqn5
Image #3: Coming back to the initial childViewController. The constraints "work" but are reacting to a different view.frame.height.
https://roryent.box.com/s/cj9ffyy3m9oh8f523l2vsdezo1frk12x
NOTE: I am creating the constraints in the ChildViewController class and trying to use the frame of that childViewController frame to do so.
I have attempted to move the methods for constraining the items into willLayoutSubviews() in the childViewController with no change.
I suspect that there is something wrong with where I am loading the different items.
I would expect the self.view.frame.height used in the childViewController code reflect the height of the UIContainerView that is displaying it. In my case the height should be .67 * UIScreen.Main.Bounds.Height.
I believe the issue was due to my implementation of the ContainerView and its corresponding childViewControllers.
I have rebuilt the feature following this tutorial and have not had any problems. https://cocoacasts.com/managing-view-controllers-with-container-view-controllers/
I have a table view where each cell contains a WKWebView of HTML content. Initially the content has its size to fit a prescribed width and height.
What I want to do is allow users to zoom in and out of the WKWebView and while adjusting the height of the cell view.
To give some context what I did was attach a Javascript (WKUserScript) to the WKWebView and in the script it contains
window.onload = function () {
window.webkit.messageHandlers.sizeNotification.postMessage({width:
document.body.scrollWidth, height: document.body.scrollHeight});
}
What this does is when the HTML content is loaded, it will send the message with name "sizeNotification" to a UIViewController conforming to the WKScriptMessageHandler. The message contains the scrollHeight which is what I use to set the frame of the WKWebView by adjusting a height constraint.
I also save that scrollHeight value which will be important later.
After the user zooms in the WKWebView the delegate method scrollViewDidEndZooming gets called which contains the current scaled information of the WKWebView's scrollView. I set the new height constraint constant of the WKWebView's frame by
webViewHeightConstraint.constant = initialHeight * scale
The height of the WKWebView increases and since I used dynamic sizing cells, the table cell height will also adjust accordingly.
That is UNTIL the zoom scale reaches a value close to 1.0
If it gets higher than this value, the content inside the WKWebView/scrollView gets white padding at the bottom.
I suspect that this has to do with the Width/Height ratio of the WebView's frame being changed, since if the initial height of the WebView is greater than content height this will also happen. Another example would be if you open a webpage in Safari that has a content height of 300px but you stretched out the window to have a height of 100px, there would be white space at the bottom (or whatever is set to)
My questions is if there's a fix/workaround for the white bottom padding issue? If you look at an email thread in Mail on iOS you can zoom in and out of the emails and the cell heights adjust accordingly.
I have a bootstrap model inside a div. I want to show a sign up form in that model. I don't want to extend the page beyond the viewport of the browser whether the browser is opened in a 15+ inch screen or a 13+ inch screen. In short I want to show the model to all the users on any screen size so that the they don't have to scroll the page to get the full content of the sign up form.
Try giving the div a max-width.