Note that there are some explanatory texts on larger screens.

plurals
  1. POUIPickerview's subviews count is always 3 in iOS 7?
    primarykey
    data
    text
    <p>I just started to migrate to iOS 7 and found several issues concerning UIPickerView in my app. And the reason is that I used the subviews of UIPickerView to customize it's background and style. I am logging the subviews count of UIpickerview and it's always is 3:</p> <pre><code>-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView { return 1; } -(NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent: (NSInteger)component { return 22; } -(UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view { UILabel* label = [[UILabel alloc]init]; label.frame = CGRectMake(152, 3,100, 16); label.text = @"test"; NSLog(@"count is %i",_pickerView.subviews.count); return label; } </code></pre> <p>I iOS 6.1, the count is always 9.</p> <p>Edit 1: Another difference: The bellow code crashes on iOS 7 and works without any problems on iOS 6.</p> <pre><code>-(UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view { UILabel* label = [[UILabel alloc]init]; label.frame = CGRectMake(152, 3,100, 16); label.text = @"test"; if(row &gt; 3){ UIView* view = [pickerView viewForRow:3 forComponent:0]; // crash in iOS 7 } NSLog(@"count is %i",_pickerView.subviews.count); return label; } </code></pre> <p>Edit 2: _pickerView.showsSelectionIndicator = NO;</p> <p>has not any affection on iOS 7.</p> <p>Can someone explain how it works?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload