Iphone uipicker视图中的整数和uiimage
我目前有一个包含两个组件的uipicker。第一个包含图像,工作正常,但第二个需要整数值 由于以下回调方法返回的UIView类型不是整数,这是否可能?肯定有办法解决这个问题 -(UIView*)pickerView 非常感谢您的帮助,非常感谢这个Iphone uipicker视图中的整数和uiimage,iphone,objective-c,ios,uikit,uipickerview,Iphone,Objective C,Ios,Uikit,Uipickerview,我目前有一个包含两个组件的uipicker。第一个包含图像,工作正常,但第二个需要整数值 由于以下回调方法返回的UIView类型不是整数,这是否可能?肯定有办法解决这个问题 -(UIView*)pickerView 非常感谢您的帮助,非常感谢这个 - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIV
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
{
switch (component) {
case 1:
{
UILabel *intvalue = view?(UILabel *)view:[[[UILabel alloc] initWithFrame:CGRectMake(0,0, 50, 40)] autorelease];
intvalue.text = [NSString stringWithFormat:@"%d",value];
intvalue.textAlignment = UITextAlignmentCenter;
intvalue.backgroundColor = [UIColor clearColor];
return intvalue;
break;
}'
}
只需返回一个UILabel显示int值我试过了,但它崩溃了,或者你的意思是实现-(UILabel*)pickerView原型?多亏了一堆adali,我意识到我添加了一个ccLabel,当然它永远不会工作:)