开发者

Iphone, pickerView controller.

开发者 https://www.devze.com 2023-03-24 07:01 出处:网络
I tried many ways, but was not successful. I have to make use of a picker. First it should have 2 components, secondly One component and finally one component.

I tried many ways, but was not successful. I have to make use of a picker. First it should have 2 components, secondly One component and finally one component. there is button,afte开发者_开发技巧r pressing this button the picker components should change as above. If there is any way please share it.


[picker reloadData];

use this in your IBAction also use int variable suppose int checker (0 for two component,1 and 1 for 1 component)

the in IBAction write code like this

checker++;
  if(checker>2)
    checker=0;
   [picker reloadData];

and it numberOfComponents datasource method use this checker for making your if else

look like this

if(checker>0)
   return 1;
else 
  return 2;

remember checker must be global type.

0

精彩评论

暂无评论...
验证码 换一张
取 消