@Override
  public void layoutSubviews() {
    super.layoutSubviews();

    CGRect bounds = getBounds();
    CGRect frame = name.getFrame();

    frame.setWidth(bounds.getWidth() - (PRICE_WIDTH + PADDING * 2));
    frame.setX(PADDING);
    frame.setY(PADDING);
    name.setFrame(frame);

    frame = price.getFrame();
    frame.setY(PADDING + (name.getFrame().getHeight() - frame.getHeight()) / 2);
    frame.setX(name.getFrame().getX() + name.getFrame().getWidth() + PADDING);
    frame.setWidth(PRICE_WIDTH);
    price.setFrame(frame);

    frame = bounds;
    frame.setY(name.getFrame().getY() + name.getFrame().getHeight());
    frame.setX(PADDING);
    frame.setWidth(frame.getWidth() - PADDING * 2);
    frame.setHeight(frame.getHeight() - frame.getY());
    descriptionLabel.setFrame(frame);
  }
Ejemplo n.º 2
0
 @Override
 public void layoutSubviews() {
   super.layoutSubviews();
   layerSizeDidUpdate = true;
 }