ios - Changing just 1 value in a view frame -
ios - Changing just 1 value in a view frame -
i new ios , alter width or height of view using next code:
view.frame = cgrectmake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, newheight);
this feels wrong because copying of old values new rect alter single value, can't do:
view.frame.size.height = newheight;
is there improve way this?
you can't assign values directly. have create variable it:
cgrect frame = view.frame; frame.size.height = newheight; view.frame = frame; // or [view setframe:frame];
ios view frame cgrect
Comments
Post a Comment