Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resize of UIViewController in storyboard

Tags:

I want to resize a UIViewController in the storyboard so I can use its UIViewController as a popover view.

On most sites I can read that the actions are:

  • drag a UIViewController in the storyboard
  • put a UIView on it
  • set the attribute on freeform and resize

But in my iOS 5.1 this does not work, even with a new project with only one UIViewController. What did I forget in the procedure?

like image 527
RNB-IT Avatar asked Mar 15 '12 22:03

RNB-IT


People also ask

What is the difference between UIView and UIViewController?

They are separate classes: UIView is a class that represents the screen of the device of everything that is visible to the viewer, while UIViewController is a class that controls an instance of UIView, and handles all of the logic and code behind that view.

Is UIViewController a subclass of UIView?

Instead, you subclass UIViewController and add the methods and properties needed to manage the view controller's view hierarchy. A view controller's main responsibilities include the following: Updating the contents of the views, usually in response to changes to the underlying data.

What is UIViewController Swift?

A UIViewController is an object which manages the view hierarchy of the UIKit application. The UIViewController defines the shared behavior and properties for all types of ViewController that are used in the iOS application. The UIViewController class inherits the UIResponder class. ADVERTISEMENT. ADVERTISEMENT.


1 Answers

We follow the following steps to achieve the same:

  1. Drag a UIViewController (this takes a UIView along with it, so no need to add another UIView unless you need more)
  2. Select UIViewController on StoryBoard and set size property to Freeform
  3. Select the UIView and set the height and width values.

If this doesn't help, you might want to delete the UIView that comes with the UIViewController, add a fresh UIView and repeat #2, and #3 above.

like image 172
danfelabs Avatar answered Sep 20 '22 13:09

danfelabs