Android compose ModalBottomSheetLayout cutting bottom when Sheet size changed - android-jetpack-compose

When change dynamic content ModalBottomSheetLayout cutting it.
[1]: https://i.stack.imgur.com/IOqHZ.png
And after that slide it to bottom
[2] : https://i.stack.imgur.com/PeBuo.png
How fix it ? I need slide down sheet without bottom cutting.

Related

SwiftUI mutilple line text not handling/alinging properly in Vstack

I'm facing alignment issue when text input is multiple lines. In this example, first image shows left and right side text is properly shown. second image, it shows when we long text it takes 3 to 4 lines which disturb alignment on the left and right side as well.
I want to make left make independently size adjust which can maximum 5 line and right side remain as it is(no gap on top and bottom side).
Not sure if I understood your problem, but if you want to align the smaller text for example to the top you need to change HStack alignment top top instead of center, if this is not you problem, please explain it more with a sketch of what you need to achieve ๐Ÿ˜‰
HStack(alignment: VerticalAlignment.top, spacing: 0)
Shown in second image, I want right side position to be always top. Right now, on left side it shows 3 line so itโ€™s changing alignment on both side which is bad. Alignment only limits on left side

Swift Storyboard - Centring an Icon and multi-line text horizontally

I am trying to create an Android-esque Snackbar. All the behaviour is correct but I am left with a layout issue. I have actually broken this out into a test app to simplify things a bit.
The bar is pinned to the bottom of the view and contains an Icon (UIImageView) along with some text (UILabel). This text can be up to 2 lines max.
For example, it should be able to exand out like this:-
However to further complicate things, i need it so that the icon and text are centred within the red bar and then spread out from the centre until such point that it needs to wrap. Note that there is a padding to the start of the icon and end of the text to prevent it touching the sides. An example of centred content would be..
I haven't been able to get the correct layout. I think the issue has been trying to centre the two items whilst simultaneously conforming to a width that doesn't exceed the edge bounds, causing a constraint conflict. I have also tried embedding the icon and label in a horizontal stack view but couldn't seem to find the correct fill option whilst centring everything.
I have even tried using NSAttributed string and adding the image to the text itself but when the text wrapped, the icon was being resized and/or misplaced.
As you can see, i have been doing this in Storyboard but i am more than happy to do this programmatically if it serves this purpose better.
Created this Demo for reference , it's a simple task of making a nested view inside the red view with a centerX constraint of priority 1000 and a leading constraint with 999 priority
Now you have this effect

iPhone X and bottom safe area inset

I am working on layout for iPhoneX and have an issue with action sheets and Safari browser. This is an extra space. I need that my action sheets display more at the bottom ? How can I do that? I guess I need to disable safe area but how can I do it?
The reason why it happens probably that I use 2 UIWindows: one for all content and the second to display banner at the bottom of the screen.
the space that is outlined - is something to hide my app from everyone :) It does not exist in the app!
I want the action sheet be closer to the bottom. It works well on all devices except iPhoneX. I have 2 UIWindows (one for all content and the second one for ad at the bottom). So, for iPhoneX the content window has probably some safe area inset and becaise of that action sheet shows not from the bottom edge
You don't have to disable the Safe Areas for the View Controller. They are still useful for the top, trailing and leading edges.
To remove the grey bar all you need is to set the bottomAnchor or your containing view to your superView instead of the bottom safe area with a constant of what you need.
You can also further adjust safe area insets with additionalSafeAreaInsets. https://developer.apple.com/documentation/uikit/uiviewcontroller/2902284-additionalsafeareainsets That allows you to leave them as is for the edges that you don't want to modify.

Xcode 8.1 Auto Layout

Hi there I am currently trying to get the following Scene to scale correctly for any scene.
This is currently how it looks on a iPhone 7 Plus:
I managed to get it to scale the blue background correctly by adding the following constraints:
However, I don't know how to get the UIImageView, UITextField and UI Label to scale in the same way. I Want them to keep the same proportions as they have now on the iPhone 7 view. I have looked for youtube tutorials but none seem to show how to introduce a way to have these items scale as I want them to.
Any help is much appreciated, Thanks.
You can add constraints between UIImageViews, Labels, the window, etc. by holding control and clicking-and-dragging between two elements. For example,
UIImageView: add these constraints:
Vertical Spacing to Layout Guide (This constrains the top of the image to the top of the window)
Leading Space to Container Margin (Left side of image stays 'connected' to the left side of the window)
Trailing Space to Container Margin (Right side of image stays 'connected' to the right side of the window)
Vertical Spacing (vertical spacing between the image and the Label)
You can use this same idea to constrain the Label and Text Field to the left side of the window and to keep the vertical spacing between the UIImageView, Label, and Text Field consistent on all devices.

Center align a view vertically to other (sibling) view iOS

i am working on an iOS project and want my 2 views to be vertically aligned with respect to each other as shown in attached image.
There is an image view on left and a view on right side. The right side view contains some labels in it. I am using autolayouts and have properly applied constraints to image view (i.e. top/leading/height/width).
Now i want my right view to be center aligned (vertically) to thumbnail but when i do this, it asks for missing constraint y position. I don't know how to fix that (i can not add top/bottom constraint as my title label can have 1 or 2 lined text and the right side view will grow accordingly)
Is it possible to achieve this? if yes, then how? Thanks.
It's a tableView basically. Above image is for detailed description. Whereas, design should be like the following (right side view should be centered aligned to left side image)

Resources