我想基于选择器视图选择显示隐藏表视图。在选择器视图中,我有四个值的数组。如果我选择value(2),则tableview可以隐藏,否则它将隐藏。
下面是选择器视图代码:
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component;
{
textfie.text = [NSString stringWithFormat:@"%@",[arrMsg objectAtIndex:row]];
NSLog([arrmsg1 objectAtIndex:row]);
NSLog(@"%@",json);
}
你可以做类似的事情,
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
textfie.text = [NSString stringWithFormat:@"%@",[arrMsg objectAtIndex:row]];
if (row == 1) {
self.myTableview.hidden = YES;
}
NSLog([arrmsg1 objectAtIndex:row]);
NSLog(@"%@",json);
}
希望这会有所帮助:)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句