ios - Making a view centered on the remaining space -


I have this view controller that shows a navigation bar at the top (white box at the top) and a toolbar at the bottom (orange Box in the picture).

Because the navigation bar is something, when the view controller is visible, the view controller is added, then the high screen size of self.view will be reported as minus 44 points.

> I've added an image view in the scene and I want to intermediate between the navigation bar and toolbar, as seen in the following picture.

Enter image details here

Whatever I did, That image was vertically to add an obstacle to centralizing the center. As you see in the picture, Xcode shows that the imageView is fully stacked because I want to focus, but it does not happen when the app runs (thanksgiving). In practice, this is what happens: Suppose I am running on iPhone 5. The iPhone 5 has 5 screen high 568 points. Because there is a navigation bar, the hight of self.view will be 524 pt (568 - 44). The hindrance will ignore the top 44 pixels neglected where the navigation bar is and see the image between the navigation bar and above the toolbar. The result is that the imageView will be close to the bottom

The image is chosen to fill the image completely between the toolbar and the navigation bar when the app is running on iPhone 4. This image also has to respect the constraints of a shape ratio. Exactly like this:

Enter image details here

Instead of centralizing the image view using a vertical centric barrier I tried to add a top barrier to the supervision and add a lower hand at the toolbar. It works fine in all iPhones, except the iPhone 4, where these two barriers force the image view to another aspect ratio, such as:

So, to see the image, what kind of constraint I have to implement, without opening it, the navigation bar and toolbar Aspect ratio to create center at center space?

If you want to be centered between the navigation bar and the toolbar, then press " Unselect both "Under the Top Bars" and "Under Bottom Bar" Add a barrier to a center in your image view, give it a reduction of 0 length spacing for 2 sides and in the end, the aspect ratio constraint. I tested this, and it worked on all sizes with a 1: 1 aspect ratio. If you want a longer aspect ratio (your image looks like ~ 1: 1.2W: H), then you need to do some extra work to make it right for 3.5 "screens because of getting that ratio There is not enough height for image view full width (assuming you have to show status bar - if not, these barriers should work on 3.5 "screens). I can include my answer to include it, how to do it, if you say that you want a aspect ratio, and if you want some minimum difference between twice, or do you want to As much as possible the aspect ratio (which means there will be no space for twice) to image view as much as possible.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -