开发者

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];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜