ios - When setting the frame of a UILabel, is it possible to set it to the vertical and horizontal center of the superview in code? -


like, cgrectmake(), have specify center, both horizontally , vertically?

  1. get dimensions of containing view.
  2. get dimensions of view inserted.
  3. x_position = width_of_containing_view / 2.0 - width_of_inserted_view / 2.0
  4. y_position = height_of_containing_view / 2.0 - height_of_inserted_view / 2.0

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -