Home Resizing UIView in runtime
Reply: 0

Resizing UIView in runtime

user624
1#
user624 Published in April 26, 2018, 1:45 pm

I have a UIView that's centered vertically and horizontally in my storyboard and has a fixed height (100) and width (300). Now I want that uiview to be resized (100, 100) during runtime.

I have tried this so far but nothing worked.

let cgRect = CGRect(x: 0, y: 0, width: 100, height: 100)

sampleView.draw(cgRect)

and

sampleView.frame = CGRect(x: 0, y: 0, width: 100, height: 100)

and

sampleView.frame.size.height = 100
sampleView.frame.size.width = 100
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.420377 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO