When create a uiviewcontroller file in my xcode the uiview size becomes so larger than the default iphone screen size like this
I can't figure out why it occurs and how resize to the default size of iphone.
Make sure while creating class this should be done
Target for iPad - Uncheck
with XIB for user interface - Check
Yeah you can do it easily. Click on the view in XIB go the fourth tab on the properties window (right side) Under simulated metrics the first accordian check the size parameter (would be 'none' by default) and change it to 'free form' when you want XIB of custom size.
Related
in my universal app I have an UITableViewController embedded in a UINavigationController. When I add a UIView to the top of the tableView and insert a UILabel which is centered in the container, the label is only visible on iPhone but not on iPad.
I tried creating a new testapp, only consisting of these two controllers, the view and the label. It works on both, iPhone and iPad. So I added two new controllers to my app in the same way and made the navigation controller the initial view controller. Label is visible on iPhone but not on iPad.
For me it seems, that I have changed some global settings in the app; on another view I have similar problems with stackViews, but I first concentrate on this "simple" problem...
Any ideas what might be wrong in my app-settings?
tableViewController embedded in navigationController
Take a UIViewController embedded in a UINavigationController. Add View, Label, and TableView and check it
Ok. Now I know what was the problem. Never have checked, what's going on with those size classes.
During development I changed from any/any to a smaller size, not knowing, that this is not only taking effect on the layout in the storyboard. Everything I added after changing did'nt show on iPad.
Solution: Select storyboard, in "File Inspector", uncheck "Use Size Classes"
So I want to have a different type of custom cell but my problem is how can I add more if there is not enough space in a certain view in story board.
E.G.
Select your view controller, and in the fourth tab of InterfaceBuilder, select 'freeform' in size.
OR
Inside the UIStoryboard, you can simply select your UIViewController and go directly to the fifth tab. Just change the Simulated Size from Fixed to Freeform .
It works for you
Choose your details view controller in storyboard, show it's size inspector and set it's simulated size to Freeform.
Thanks to Bhavin Ramani that answer is:
In storyboard: Select YourViewController > Attribute Inspector > change size inferred to Freeform and set height as per your requirement in size inspector
My iPad application is fixed on landscape, and can't be changed during the whole lifetime.
I setup the project as:
and then in storyboard, I set the orientation as the landscape, but I don't know why the view does not change to landscape?
Note: I am using Swift, XCode6.3.2, iOS8.1
In the any | component click on it and mouse over you can see the bottom text said the size of view for iPhone and iPad like following images.
if your application size class desable then that show direct reflaction like old way. but when your app size class enable that need to use with wAny hComponet
if size class enable with landscape:
Same if size class disable with landscape:
If you want to use size class then you need to check viewcontroller preview like following step:
Select view controller and then click on show the assistant editore.
Then you have two part on your xcode like following:
select a preview from following dropdown screenshot:
after select prview you can see the right side one view that is the preview of your viewcontroller view's you can change it landscape or portrait by following.
you can also check with all size by create new preview view by following.
In simulated metrics, you've got the size selected as Inferred. If you want to see what it looks like on a specific device type, select that from the first drop down list.
In the storyboard, the scene is universal so that you can use auto layout to adapt for various devices and orientations.
You can select iPad specifically from the simulated metrics:
Or you can, modify universal storyboard layout from the bottom panel.
Updated answer for Xcode 8 -
Click the View as: text at the bottom of the storyboard.
I want interface builder to display a 3.5 inch iphone mockup and work on it. Where do I configure it?
You can set the main .xib file's property by selecting it and go to Assistant Editor and within Simulated Metrics section, size property to Retina 3.5 Full Screen
here i have mentioned how to change the size using storyboard
You can set Size property of main UIView in .xib to Retina 3,5 Full Screen.
If you are using a storyboard file: Select the view controller and you will find the simulated metrics in the Attributes Inspector. Then simply change the size from 'Inferred' to 'Retina 3.5 Full Screen'.
The easiest way to select a view controller in a storyboard is to click the left bar item below your view - see screenshot.
I have an xib file with the image like this:
When I run it, it seems to downsize to this:
Width:320 Height:370 is the values I have given. There is a navigation bar above and a tab bar below.
Should the image show normally? it seems to be resized.. not sure why...
How do I avoid the shrinking?
Need some guidance.. Thanks...
*EDIT1 *
Huge apologies.. I am using iPhone(Retina 3.5 inch). that is why it is appearing on the middle. How do i ensure that it remains at the bottom for iphone(Retina 4 inch), iPhone (Retina 3.5 inch) and iPhone?
*EDIT2 *
in iphone 5, it looks like this:
How to avoid this?
please add bottom bar as tabbar in xib file ...
Open your xib and select your view then Uncheck the "Use AutoLayout" property from
File Inspector(Option+Command+1)
Select the image in the xib editor and set the mode to "top".
You need to set autoresizingmask of your view and imageview to UIViewAutoresizingFlexibleTopMargin if you want they stay bottom all the time.
And you need to remove UIViewAutoresizingFlexibleHeight.
You can do it with code or in interfacebuilder.