Get UITableviewCell position from “visible” area or window

前端 未结 3 1662
[愿得一人]
[愿得一人] 2020-12-28 15:30

I create an iPhone app base on uitableview and uitabbar. On each cell of tableview i have an \"add to favorite button\". When i pressed this button, i want to make the cell

3条回答
  •  独厮守ぢ
    2020-12-28 16:03

    Yes this is possible like that

    -(void)click:(id)sender
    {
        int clickcelltag;
        clickcelltag=sender.tag;
    
        NSIndexPath *index =[NSIndexPath indexPathForRow:clickcelltag inSection:0];
    
        [userreviewtblview scrollToRowAtIndexPath:index atScrollPosition:UITableViewScrollPositionTop animated:YES];//userreviewtblview is a UITableView name
    }
    

    Hope this will help you :-)

提交回复
热议问题