zqk.gif
//MARK: 创建发布商品的btn
-(void)creatPublishGoodsBtn{
_addButton =[UIButton buttonWithType:UIButtonTypeCustom];
_addButton.frame =CGRectMake((MainScreenWidth -40)/2, MainScreenHeight -50, 40, 40);
[_addButton setBackgroundImage:[UIImage imageNamed:@"postNew"] forState:UIControlStateNormal];
[_addButton addTarget:self action:@selector(postNewTieziInPindao) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:_addButton];
}
//MARK: <scrollView delegate>
- (void) scrollViewDidScroll:(UIScrollView *)scrollView{
if (scrollView != _tableView) {
return;
}
if (scrollView.contentOffset.y > 0 && (_contentY - scrollView.contentOffset.y < 0)) {
if (_addButton.hidden == NO) {
_addButton.hidden = YES;
}
}else{
if (_addButton.hidden == YES) {
_addButton.hidden = NO;
}
}
_contentY = scrollView.contentOffset.y;
}
网友评论