sai kiran sai kiran - 1 year ago 84
Objective-C Question

How to set a fixed frame for a label?

I have a custom cell with 2 textfields and in view for header in section I'm taking a view and displaying two labels at x positions 5 and 180. at 180 the position of view changes everytime i change the device. i want the 2 nd label frame to just above the 2nd textfield. how it can be done?

Answer Source

You can set second textfields frame as :

int margin = 5;
UITextField *txtFieldSecond = [[UITextField alloc]initWithFrame:CGRectMake(5, CGRectGetMaxY(txtFieldOne.frame)+margin, width, height)];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download