【问题标题】:when I select tableview row that time scrollview is open so how do I get what is index no. of tableview and what is position of scrollview当我选择 tableview 行时,滚动视图是打开的,那么我如何获得索引号。表视图和滚动视图的位置是什么
【发布时间】:2014-01-25 00:12:51
【问题描述】:

当我选择 tableview 行时,滚动视图是打开的,所以我怎样才能获得索引号。表视图和滚动视图的位置是什么 我的代码是

-(void)tableView:(UITableView *)tableView SelectRowAtIndexPath:(NSIndexPath *)indexPath{
    AppDelegate *objAppdelegate = [[UIApplication sharedApplication] delegate];
    if (objAppdelegate.isLegalUpdate_Event_CA==1){
        UIWebView *webvews=[[UIWebView alloc]initWithFrame:CGRectMake(scrolvew.frame.size.width * i, 50, 320, scrolvew.frame.size.height-50)];
        webvews.delegate=self;
        [webvews loadHTMLString:ObjtpostAll.post_content baseURL:nil];
        //webvews.backgroundColor=[UIColor redColor];
        webvews.backgroundColor=[UIColor whiteColor];
        [scrolvew addSubview:webvews];
        [webvews release];
}
   scrolvew.contentSize = CGSizeMake(scrolvew.frame.size.width * [pullRefereshTableViewController.arrData count], scrolvew.frame.size.height);
    [scrolvew setContentOffset:CGPointMake(indexPath*320, 0)];

【问题讨论】:

  • 你真的要覆盖selectRowAtIndexPath:animated:scrollPosition:吗?

标签: ios iphone uiscrollview delegates stack-overflow


【解决方案1】:
CGFloat xOffset = _yourScrollView.contentOffset.x;
CGFloat yOffset = _yourScrollView.contentOffset.y;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-25
    • 1970-01-01
    • 2013-12-30
    • 2017-01-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多