I need to display large content in mine UIViewController, added to the Storyboard, so I added UIScrollViewwith restrictions on the top, right, bottom, left: 0 (to make it fullscreen).
At the top, UIScrollViewI need a square image with its width as the screen size of the device, so I added UIImageViewwith restrictions: aspect ratio → 1: 1, top: 0, center alignment in the container, height: 100. And below that there is UILabelwhere I want show large text. I use automatic layout.
- Is there any way to do this in a storyboard?
- In quick I tried below
The connected image in the controller file:
@IBOutlet weak var eventThumb: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
eventThumb.image = UIImage(data: NSData(contentsOfURL: NSURL(string: self.event!.image)!)!)
let screenSize: CGRect = UIScreen.mainScreen().bounds
eventThumb.frame = CGRectMake( 0, 0, screenSize.width, screenSize.width)
}
, , , , .
swift ios, - ?
:
