开发者

UIView initWithFrame overwrite view height

开发者 https://www.devze.com 2023-01-13 12:44 出处:网络
I have a UIView with a 开发者_运维技巧NIB. The view in the NIB is set to 280 x 390. When I add the View inside another view I \"something\" do this

I have a UIView with a 开发者_运维技巧NIB. The view in the NIB is set to 280 x 390.

When I add the View inside another view I "something" do this

view_name *view = [view_name alloc] initWithFrame:CGRectMake(0, 0, 280.00, 390.00) ];

[outer_view addSubview: view];

Now in certain instances I need to make the view smaller as there is other content on the page. I tried to change the initWithFrame variables but it does not work.

How can I do this? Cheers!


put a uiscrollview, set its size to your desired one, and add your view as a subview to the scrollview.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号