I have a UIView subclass that I want to be 50x50; When I load it it always takes up the entire screen How can I solve this?
Posting some code would help us help you, but here's how you set the frame of any UIView subclass:
// When creating the view...
UIView *yourView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)];
// or after having created the view...
yourView.frame = CGRectMake(0, 0, 50, 50);
// ... or
[yourView setFrame:CGRectMake(0, 0, 50, 50)];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.