SegmentControllerer First segment should always been selected when i start the application in iphone
I am using a segment control.
in tha开发者_运维百科t there are three segments..segment 1,segment 2,segment 3..
My problem..
when I start the application..
I want that the first segment should always selected..
Suggestion please...
segmentedControl.selectedSegmentIndex = 0;
somewhere in your startup code.
Did it...!!!
In viewWillAppear i put the below code...
switch (selectedTag){
case 0:
segmentControl.selectedSegmentIndex = 0;
break;
case 1:
segmentControl.selectedSegmentIndex = 1;
break;
case 2:
segmentControl.selectedSegmentIndex = 2;
break;
default:
segmentControl.selectedSegmentIndex = 0;
}
[super viewWillAppear:animated];
[self.myTableVies reloadData];
精彩评论