Pawriwes
Pawriwes

Reputation: 293

how to support rotate in the textbox created by code?

I created a text box by code in Xcode, by giving

if (isLandScape) {
    textFieldRounded = [[UITextField alloc] initWithFrame:CGRectMake(800, 10, 200, 30)];
}
else {
    textFieldRounded = [[UITextField alloc] initWithFrame:CGRectMake(550, 10, 200, 30)];
}

but when rotated, two box are created, I dont want this, what is the treatment for my code?

Upvotes: 0

Views: 245

Answers (1)

Denis Mikhaylov
Denis Mikhaylov

Reputation: 2045

  1. Take a look at autoresizingMask property.
  2. In what method are you creating this view?

Upvotes: 1

Related Questions