作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的 UIPickerView 使用 pickerView:viewForRow:forComponent:reusingView:
方法检索其数据。
由于某种原因,该方法不会影响 iOS 4.3 及更低版本。
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
{
UILabel* label = (UILabel*)view;
if (view == nil) {
label = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease];
}
label.text = @"Text";
return label;
}
最佳答案
这个人做了一个例子,他指出 View 不应该自动释放。 http://alisothegeek.com/2009/07/custom-uipickerview-text-formatting/
关于iphone - UIPickerView pickerView :viewForRow:forComponent:reusingView: does not affect below iOS 5. 0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10784691/
我的 UIPickerView 使用 pickerView:viewForRow:forComponent:reusingView: 方法检索其数据。 由于某种原因,该方法不会影响 iOS 4.3 及
我是一名优秀的程序员,十分优秀!