How can I set ion-modals height to be equal to its content - ionic-framework

I have a modal which should have height based on its content, since content could differ from modal to modal. Modal is shown from bottom of the page and is not full screen.
How can I achieve modal behaviour where modals height is equal to its content. Currently whenever modal is opened I calculate height of modals content and then set modals height to it, but this is very bad IMO since it does this on every modal open. If I set height to something like auto or content-fit it is not shown at all. There must be easier way to do this.

Related

Notification Content Extension Header Height

How can the height of the 'Header' to a content extension be ascertained at run time (including the dismiss button)?
I have a content extension that lazy loads content, and then is dynamically resized by manipulating the preferredContentSize of the View Controller.
The content we need to show could be very long and tall, taller than the screen of the device. The content should not display past the edge of the screen, which would cause the user to scroll. If the content is long and tall we need to take into account the height of the content extension's header and dismiss button to calculate a content size that will fit on the screen. The sizing code could use a magic number for this height <104px, indicated by the red square in the included image>, but it would be better to dynamically calculate it.
From debugging, it's not clear what object I have access to at runtime that will allow me to find the origin of the Notification Content Extension View. Any ideas?

bootstrap v4 modal height 100% (media-sensitive)

How to set height of modal window min-height 100% via classes? For example, h100 for all screens, and h100-sm-up, h100-md-up?
It looks very well if modal height is as usual, but at mobile it resizes to 100% height.

Navigation bar and UIWebview

I am having some slight issue and trying to fix it but can't find the easiest answer towards it. I have a navigation bar, which is taking top pixels away, and hence the webview content last 44 px if I am not wrong goes under the bounce and hides the content. Hence the problem is that I have a submit button, and since it needs to be clicked, it goes under the bounce condition and doesn't let me select the button. Any quick solution to this problem will be appreciate.
Thanks
Make sure your UIWebView has the autoresizingMask set to be flexible in height and width. You can do that in interface builder or in code.
You can set the bottom content insets to 44. But it seems your view is not put correctly (web view size does not take navigation bar into account, web view is not resized properly, etc.) I would fix that instead of patching with the insets fix.

iPhone App Phone Call Situation

When a phone call occurs, my app moves down, and the bottom of the app is cut off slightly. Is there anyway to shrink or resize that whole view when a call occurs.
Preferably through interface builder.
Indeed, your application window does shrink its subview. For example, if you have a status bar so the frame of your root view is (0,20,320,460), then if the in-call status bar is on, then the frame becomes (0,40,320,440).
Then why does the bottom of your app seem to be cut off? It's simply because the root view autoresizes its content in that way. For example, its autoresizingMask property says it has a fixed top margin and a fixed content height. So,
If you want to 'squeeze' the view, try fixing both top and bottom margins and having flexible content heights.
If you want the in-call status bar to look as if it goes over your app, fix the content heights and the bottom margin, and have a flexible top margin.
If you have a fixed top margin and a fixed content height, then your app will seem to slide down.

How to make modal view scrollable?

I have a modal view with a textview and a button. When the keyboard is displayed it covers up some of my UI elements. I'd like my modal to be scrollable so that it can be viewed while the keyboard is displayed. How can I do this?
I've had the same question, and i've played with it a bit,
setting a UIScrollView is not enough, as in the inspector
you should 1st. increase it Hight, then in the attributes, check the following checkboxes:
Scrolling enabled, Bounce Scroll, always bounce vertically.
Edited: Forgot the most inportant thing:
in the size inspector, set the Buttom field (under content) to the size you wish, (960 is twice the regular size)
Use a UIScrollView instead of an ordinary UIView. You can disable scrolling when you don't want the user to be able to with:
[theView setScrollEnabled:NO];