Dragging UITableView

前端 未结 3 1664
没有蜡笔的小新
没有蜡笔的小新 2021-01-03 16:38

I\'m working on an iPhone application where I want to drag the table view (not the cells) upto a certain point in the screen. I have the tableview sitting in the bottom half

3条回答
  •  独厮守ぢ
    2021-01-03 16:49

    If I rightly understand the question, the simplest solution is to programmatically set the tableView header to the desired image. (I think this is like what Path does for setting a location, with the exception that they are using a map not an image.)

    UIImage *image = [UIImage imageNamed:@"image_name"];
    UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
    [self.tableView setTableHeaderView:imageView];
    

    This is equivalent to dragging a UIImageView, with the appropriate image, onto the tableView header in a storyboard.

    Please note: The table header view is different from a section header. See Documentation for more info.

提交回复
热议问题