iPhone应用程序中的分段控件

时间:2009-04-27 12:36:16

标签: iphone

我已将UIsegment Control放入我的iPhone应用程序中。要加载页面我有这个功能 - (void)segmentSelected:(id)segmentedCntl {     NSLog(@“选择的段索引=%d”,[segmentedCntl selectedSegmentIndex]);
    int index = [segmentedCntl selectedSegmentIndex];

ViewController *viewController = (ViewController *) controller;
NSString *xPath = [NSString stringWithFormat:@"item[%d]/a", (index + 1)];
NSArray *items = [element nodesForXPath:xPath error:nil];
if([items count] > 0){
    CXMLElement *itemElement = (CXMLElement *) [items objectAtIndex:0];
    NSString *url = [[itemElement attributeForName:@"href"] stringValue];
    NSLog(@"url is &&&&&&&&&&&&&&&& %@", url);
    if([url startsWith:@"#"]){
    }else{
        NSString *fullURL = [URLLoader getURL:url];
        if(fullURL != nil){
            if([fullURL contains:@"?"]){
                fullURL = [fullURL stringByAppendingString:@"&iPhoneMode=app"];
            }else{
                fullURL = [fullURL stringByAppendingString:@"?iPhoneMode=app"];
            }
            [viewController showURL:fullURL cacheDuration:kPageCacheDuartion];               
        }
    }
}

}

但是segmentControl不可点击。请帮我解决这个问题

1 个答案:

答案 0 :(得分:0)

Namastey saikamesh

请检查您的UISegmentedControl属性设置是否正常。