UA-17470720-3

Jump to content


Photo
- - - - -

Adjusting size of picker cell

cells

  • Please log in to reply
No replies to this topic

#1 David DelMonte

David DelMonte

    Forum Master

  • STV 4.0 Pro
  • PipPipPipPipPipPipPip
  • 527 posts
Reputation: 41
Excellent

Posted 14 October 2012 - 04:24 PM

Hi, I'm trying to set the width and height of a Picker Cell.

I have this code:


- (void)performInitialization

{

[super performInitialization];


// place any initialization code here


self.selectionStyle = UITableViewCellSelectionStyleBlue;


pickerView = [[UIPickerView alloc] init];

pickerView.dataSource = self;

pickerView.delegate = self;

pickerView.showsSelectionIndicator = YES;


// Calculate the screen's width.

float screenWidth = [UIScreen mainScreen].bounds.size.width;

float pickerWidth = screenWidth * 3 / 4;


// Calculate the starting x coordinate.

float xPoint = screenWidth / 2 - pickerWidth / 2;


pickerField = [[UITextField alloc] initWithFrame:CGRectZero];

[pickerView setFrame: CGRectMake(xPoint, 50.0f, pickerWidth, 200.0f)];


pickerField.delegate = self;

pickerField.inputView = pickerView;

[self.contentView addSubview:pickerField];

}


But get this console output:



-[UIPickerView setFrame:]: invalid height value 200.0 pinned to 180.0






Also tagged with one or more of these keywords: cells

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users