Change size of element more precisely in storyboard - iphone

I'm working on Xcode version 4.4. Couldn't find the way how to change element's(UIView) size more precisely in storyboard. I can drag anchors of element, but It's difficult when elements are small.
Is there any way to change width and height of element by one pixel?
EDIT: Development environment is iOS(not Mac OS).

You can edit a view's position and size in the Size Inspector. Select the view you want to modify, then from the menu bar choose View > Utilities > Size Inspector.

In Interface Builder, you should be able to use the inspector to edit the object's properties.
Check out this link, specifically point 7: http://developer.apple.com/library/ios/#documentation/IDEs/Conceptual/xcode_quick_start/020-Tutorial_Designing_a_User_Interface_with_Interface_Builder/interface_builder_tutorial.html

Related

How to auto Layout Labels

I want to layout my labels like this using auto layout. It works fine in iPad 10.5. But when I move to any other versions of iPad with a larger screen, this design brokes. Anyone, please help me to solve this problem.
Swift 4
Use stack view
Step 1. insert labels inside of stack view
like that
Step 2. add constraints on stack view
from top, bottom, left and right alignment according to your requirement
like that ->
Step 3.
Use Stackview properties
a.) set axis of Stack view Horizontally as well as vertically.
b.) set alignment according to requirements.
c.) set Distribution according to requirements (here i used fill equally).
b.) set Spacing between labels .
See here ->
Now run. it will work, it will show same in all Device like iPhone and iPad and also (horizontal and vertical).
it will show like this(iPhone6splus)
Thank you
It seems like you create/checked constrations only for iPad or iPhone. Change a type of device scoping on Storyboard editor and you can find errors. Take care about UI for all of device types.
You can add constraints by "Add missing Constraints".
1.select your labels
2.And click the "Add missing Constraints"

NSTableView: second Column appears when it shouldn't

I have an NSTableView with only one column. When I change the Windows size, the TableView sticks to the Windows borders, as it should:
ScreenShot Small
However, when I expand the windows frame to much (for example, when using full screen) suddenly a second column appears:
ScreenShot FullScreen
I have no idea, why this is happening. I can't expand the first cell manually using this little resize indicator, it seems like the cell inside the tableview just wouldn't be able to grow more...
Here is a picture of the TableViews Attributes Inspector:
ScreenShot AttributeInspector
I didn't find any constraints or width settings that would explain this.
I would be really greatful for any kind of help.
Try changing the column sizing of tableView to Uniform in attributes inspector.
Also in your size inspector, check and adjust maximum width for the column depending on your window max allowable width.

Xcode 8 forces to 'Choose an initial device view'

I currently updated to Xcode 8 GM.
When I try to see my storyboard, above window pops up and there's no way to avoid this settings.
I chose 6s screen and all my view controllers changed to 6s size.
It will be much harder to adjust layout constraints on that small screens.
I believe it's possible to change the size to iPad but I want to know what this is first.
No way to comeback to ambiguous sized view controllers?
What is this settings for?
A way "come back to ambiguous sized" can be:
Select all the Scenes(View Controllers) in the Storyboard, show the Size inspector, change the Simulated Size to Freeform, then set Width Height = 600.
Then, those tons of warnings disappear.
In Xcode 8.1 updated version, there is a shortcut button for this.
For cases, when only updating of the Xcode fired these warnings, just select the problematic view's superview (containing mentioned constraints), and click this update frames button:
Select warning in the Scenes (View Controllers)
Select 'Update Frames'
Check 'apply to all views in the container'
Select 'Fix Misplacement'
Or
Select View in the Scenes (View Controllers) in the Storyboard
Select 'Resolve Auto Layout Issues'
Select 'All Views -> Update Frames'
Then, those warnings disappear.
Its easy to do in XCode 8.1
pedrouan answer is perfect. I am just adding the same answer in pictorial representation.
I just opened up my xib file of complex cell and its a lot of warnings; You can see in following picture:
You just need to select top level view/cell in xib hierarchy and click 'Update Frames' button; Everything will become perfect.
All warnings will gone like following screenshot:

Autolayout UIButton and UILabel font size according to specific type of the iPhone size[NOT PROGRAMMATICALLY]

I want to set different font size according to the IPhone size (4, 4.7 or 5.5 inch) Here is one of the solution
But I want to ask is there is any way to auto resize UIButton / UILabel font size through interface builder without code? For example, how it works with holding ratio width - height of the UIsmth size?
If there is no way to do it as I described - what is the best practice to set font sizes. Should I do it as separate file for each UI element or it s better to do it in the appropriate UI elem subclass?
To concrete the question - I'm writing an web app for iPhone portrait only
Yeah it's possible you can use sizeClass for it.
Select the viewController wich you want to change the sizeFont, then
HERE:
You select the sizeScreen you want (it will appears blue where you see "any/any" ) and then select the textField, go to the
Attributes inspector
and choose a new size clicking the plus button in the font section :
You will see something like this:
Select and change the size you want, It will work for you

Swift Storyboard Auto Size Classes

i have a problem. I had a storyboard in Xcode 6 with the inferred size of the view controller and the "Use Auto layout" option checked. Today i wanted to use the new " Use Size Classes" option. I checked the option and then in the simulator the screen was all black!
EDIT
now that i resolved this issue i have another thing here ! I use "Add missing costraints" option to have a resize for all Apple Device, the Tab bar and navigation bar are good, but then all the buttons ( they have an image ) are in different position !
How i can resolve that ? Thanks in advance.
A black view.. if not always, is a good indicative that the view is not loaded. Size Classes introduces a new concept ...You can have several views that will be installed or not into your view depending of your view configuration. More details on images below:
This is what you will be looking for:
This is what I call view rendering configuration (sure Apple has another name for it). It is located at center bottom of your storyboard view.
This is always located at the end of Attributes Inspector tab:
Make sure it is enabled for the view that suits your testing device.
I found out that the ViewController wasn't set as Initial Controller.
You should avoid as possible the use of "add missing constrains". Is an automatic tool that almost always ends up adding unnecessary constrains or breaking others.
If you want something to look really good an stable, sadly there are no shortcuts... you will eventually end having to do it all by yourself.