forum

Home / DeveloperSection / Forums / How to create rectangle on UIView in iOS?

How to create rectangle on UIView in iOS?

Anonymous User 1682 20-Jan-2016

I want to create a rectangle shape on our view controller.
I tried it by using this code:

UIView *frameForView = [[UIView alloc] initWithFrame:CGRectMake(0,0,70,70)];
frameForView.backgroundColor=[UIColor greenColor];

I think the above code is correct but I don't understand that how can I fix it on our view controller.
Please tell me what's wrong in my code.


Updated on 20-Jan-2016
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By