My storyboard is not edge to edge with the screen [closed] - swift

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I'm adding an image but it won't go fullscreen with the iPhone XR, it has white space around it
I tried zooming it in and out for refreshing it, but still won't go fullscreen
I expect the image to go fullscreen

It sounds like you've aligned your image to the Safe Area guide rather than the view edge.
Safe Area guides are inset a bit on iPhone X/XR devices to allow space for the home indicator or the sensor housing (notch). If you want your view to fill the superview, make sure your layout constraints are attached to the superview edge rather than the Safe Area edge.
To fix this, edit your existing constraint from the storyboard, changing the item from Safe Area to Superview:

Related

Unity2D Simulating height with Top Down Shadows [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
So the problem is the following:
I have been trying to make this flying simulator little phone game, the problem is i cant make the shadow change with a smooth transition...
That White squared is a cloud, and the objective is to have the shadow change size while in the cloud...
I don´t really know were to start, i tried shaders, but i´m not that good with that...
Thx :))
If you are not into shaders, I would look into Masks. Masks basically limit a sprite to only draw within it's boundaries.
In this example, you could have a mask on the cloud. To make it work, have the "nearer" shadow be always drawn, but only in the mask's boundaries (In this case - the cloud) Relevant Youtube Tutorial

Constraints not update swift [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
Hello,
I am having trouble with constraints and was hoping for a little guidance.
In the image attached.
1 = What I start out with. The red section is a table view, the blue is a button.
2 = What is happening.
3 = What I want to happen.
I have an autolayout constraint from blue to red. But sometimes the red section hides a section in it and gets smaller, but the blue area does not follow when this occurs.
Im just curious if I need to programmatically set another constraint on the blue area. OR like refresh the constraint somehow so it knows to move up to the red area.
The UITableView isn't actually getting smaller or larger. Even if it doesn't have a lot of content inside of it, the frame stays the same.
If you want the behavior in 3, you could put the button in it's own cell in the table. Then it would always be at the bottom of the rest of your cells.

How big should touchable area be? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I am porting a web app to a mobile app using phonegap. In it there is a window control that is resizable similar to windows in Windows, i.e. clicking the edge and dragging.
My initial thought is to simply translate touch events to mouse events, and when doing this I notice that the edges, i.e. the touchable area need be rather big in order to be able to hit it with a touch.
I am wondering how big should an area be in order to conveniently be able to touch it? My second solution is to build the resize using pinch zoom or something else.
48dp.
http://developer.android.com/design/style/metrics-grids.html
Why 48dp?
On average, 48dp translate to a physical size of about 9mm (with some variability). This is comfortably in the range of recommended target sizes (7-10 mm) for touchscreen objects and users will be able to reliably and accurately target them with their fingers.
If you design your elements to be at least 48dp high and wide you can guarantee that:
your targets will never be smaller than the minimum recommended target size of 7mm regardless of what screen they are displayed on.
you strike a good compromise between overall information density on the one hand, and targetability of UI elements on the other.

iOS 7 dynamically change speech bubble color in messages [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Trying to figure out how to incorporate this effect into my app.
It is essentially the adjustment of the colors in the speech bubbles when the user scrolls, as seen in the messages app in iOS 7.
The bubbles close to the top of the screen are light blue, the bubbles towards the bottom are darker.
Create a gradient on your views. Set the start and end color's intensity according to the view's position in the scroll view's superview (using convertRect:toView:). As your scrollview scrolls, update the visible bubbles' background colors according to their current position. An optimization is to only update the views which are visible. Using a table or collection view can help you with that. It's a simple yet effective effect.

Show some scaled images in a gallery [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have an array of images, these images can be taken from camera or photo library, so it can be on different sizes.
The images are displayed as thumbnails like on photo library, and my goal is to show one image on screen with a screen related size once it is tapped, then i can move to the next image with a gesture, also as the photo library.
My main problem is i don't know the size of an image view to fit the images on screen, i tried to scale them, but as i can have several sizes of images i can't find a pattern to scale (images of different sizes should be scaled differentially).
So, how can scale these images to fit on screen proportionally to it's size(again, like photo library)?
On UIImageView you can setup a scaling mode that should help fit the images onto the screen as nicely as possible. Essentially you want to "fit" the image onto the screen by either padding the small sides with empty space, or clipping the edges of the largest sides.
Keep imageView.frame uniform for all images and play with both of these options to find out what works best for your needs:
/* no clipping - empty space on sides */
imageView.contentMode = UIViewContentModeScaleAspectFit;
/* clipping - no empty space */
imageView.contentMode = UIViewContentModeScaleAspectFill;
An answer (scroll down) here illustrates the difference with a nice diagram:
How to scale a UIImageView proportionally?
did you already check the Collection View Controller? You use that kind of container type for your application.
http://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/CollectionViewPGforIOS/Introduction/Introduction.html
Another way would be to add implement an own logic... You create several e.g UIImageView's and than implement an logic to detect the smallest one. Based on the smallest "frame" you resize the other Views till they match the size of the smallest UIImageView based on his height...
But I think its much more comfortable to use the collection container :D
In addition here is an tutorial how to handle it if you dont want to read the full documentation from apple but I recommend to read it anyway!
http://www.raywenderlich.com/22324/beginning-uicollectionview-in-ios-6-part-12
this tutorial was created by Brandon Trebitowski
thank you
best regards