On my phone the view seems to be zoomed in (to large for the screen)
Screenshot from iphone 5s
Compared to when Im building it in xcode:
i control clicked dragged every where and now it does auto layout itself
Related
I have a view controller with some fixed labels, steppers etc. The layout looks fine in iPhone5, 6/6 plus, but when i try in iPhone4s the view just doesnt scroll down to show other content.
Should the scrollbar not appear automatically when the content does not fit in screen size?
Here is how the layout in iPhone 4s looks along with how it should actually look
It would be great if someone can help me identify why is the content not scrolling for iPhone4s
Thanks in advance
No, it should not scroll automatically. You need to embed your view into a scroll view or (better) use table view.
I have a view which perfectly fits all other screens except iPhone 4s and below.At first I implemented scrollview for the view in iPhone 4s and below, but now scroll view has to be removed and the only go is to check weather the device is below iPhone 5 and adjust the frame so that content fits in screen. I have checked and tried updating frame of the view for models below iPhone 5.This doesn't work and the frame doesn't get updated as I am using auto layout. In short if the model is below iPhone 5 i want to update my y of the origin of the frame so that view is completely seen. Any methods ?
It is a little bit difficult to understand your question.
If you set the bottom layout constraint of the scroll view to be in line with the bottom layout guide of the main view, the scroll view should resize to fit the screen regardless of the model of phone.
It sounds like your issue is not with the scroll view frame but with the size of its content. I am not entirely sure though what exactly the issue is... i.e. what you are seeing versus what you would like to see.
I'm making an app for iphone. My layout can be the same for iphone 4, 4s, and 5 but for the iphone 4 and 4s the only thing that change is space between buttons. I finished my app and i arrange all storyboard to run well on iphone 5. Now i only have to tell that when the app running on iphone 4 and 4s i have to change the space between the buttons in some views to get all buttons inside screen. How i can do this? I can use auto layout i think but i dont use this. Its possible to help me? I do the things right, doing the design first for iphone 5 and now adapt for iphone 4 or im doing the things in the wrong way.
Regards
The IOS6 autolayout it's still a bit "wild" and it will also disable the IOS5 compatibility.
If you don't use autolayout, you can still set some rules in storyboard at size inspector, like tide you buttons to the top or the bottom of the view, so you can control where they go when the screen shrinks.
A better way is to add subviews to your view, and allow the subviews to shrink and expand (also # size inspector in storyboard). Then add your buttons to those subviews, tide them to the top, bottom, or let them untied/free if they are placed symmetrically inside the subview.
You can simulate quickly with the form factor button in storyboard (right-down corner) to see where the buttons go when you switch the sizes.
These methods require zero lines of code, but more work with the storyboard.
I have a Xcode 4.5.2 Project
I have a story board with with four UIViews.
Autolayout is Set to ON in the StoryBoard
Deployment is iOS 6
I want the letterbox to appear on top and bottom when running on iPhone 5 and not have my views resized when running on a iPhone5
When I run my app in iPhone5 - I do not see the letterBox - the UIViews are automatically stretched (incorrectly)
When I run the App on iPhone 4 - Everything is as expected.
Why does the letterbox not show as I would expect?
If for some reason you want your app to behave on iPhone 5 the way older apps do -- automatically letterboxed by the OS to 3.5-inch screen dimensions, just don't include a Default-568h#2x.png in your app. However, Apple expects new apps submitted to the App Store to support 4-inch screens, so you might not get very far with this strategy if you're expecting to distribute your app that way.
If you want to "support" iPhone 5 (and iPod touch 5th generation) screens, but keep most of your UI at older screen sizes... well, your users may not like it (and the App Store reviewers might not either), but it's possible using Auto Layout. The catch is that the root view in your window's (or rather, your view controller's) view hierarchy is always automatically resized to fit the screen -- but there's no saying that has to be the main container for your actual UI content.
In IB, with the editor in 3.5 inch screen mode, drop a new UIView into your view controller's root view. It should automatically size to fill the screen (460 points high).
Add a Pin > Height constraint so the view stays 460 points high no matter how its superview gets resized.
Add an Align > Vertical Center in Container constraint so the view stays centered when the height of its superview changes.
Put all of your UI inside this view.
Now you'll get white bars (change the color of the root view if you like) above and below your UI when on iPhone 5.
Note this only works as long as your UI doesn't rotate to landscape. I don't think you can do this kind of artificial letterboxing for both orientations using only one set of constraints, so if you want to support rotation you'll need to respond to an orientation change by switching out constraints programmatically -- pin height and center vertically in portrait, pin width and center horizontally in landscape.
i am wondering how its possible to have an iphone nib that has some uitextfields and some labels to be automatically repotitioned if the device is an ipad. (i dont want a second nib) im trying to get my iphone nib to autoresize in the middle of the screen if the device is an ipad so that all the text fields and buttons arent placed in the top left corner. I tired using the autosizing masks however they wouldnt work for the textfield(im not sure why exactly the horizontal autoresize didnt work) is there any way i can do this without making a new nib if the device is an ipad?
thanks
I'm unsure if this would work, but you might try using a view that's the same size as the iPhone screen, set the autosize flags on that to keep it in the middle of the screen without stretching it, then put all of your views inside that view.