Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] 首页分类编辑,怎么固定首个不动? #1

Open
yanchaoGan opened this issue Feb 1, 2018 · 5 comments
Open

[feat] 首页分类编辑,怎么固定首个不动? #1

yanchaoGan opened this issue Feb 1, 2018 · 5 comments

Comments

@yanchaoGan
Copy link

[feat] 首页分类编辑,怎么固定首个不动?

@tianliangyihou
Copy link
Owner

跟最后一个差不多,你在前面给个占位的空文字,然后放一个按钮。

@yanchaoGan
Copy link
Author

yanchaoGan commented Feb 2, 2018

理解了。加一个不用的。 怎么在其他拖动的时候,他不能被移动?

可以添加个协议?,针对哪个item能不能拖动,返回bool 确认。可支持全部位置?

@tianliangyihou
Copy link
Owner

我好像理解错了,你说的是我的频道里面,点击编辑按钮后,拖动交换按钮的位置是吗?
要是这样的话,我也不知道该怎么给你说清楚
你看看HNChannelView这个类吧

@yanchaoGan
Copy link
Author

  • (void)newLocationTagForBtn:(HNButton )moveBtn locationBlock:(void(^)(HNChannelModel targetModel))locationBlock {
    HNChannelModel *moveBtnModel = moveBtn.model;
    CGPoint moveBtnCenter = moveBtn.center;
    dispatch_async(_queue, ^{
    NSMutableArray *models = [[NSMutableArray alloc]initWithArray:self.datas];
    for (HNChannelModel *model in models) {
    if (model == moveBtnModel) {
    continue;
    }
    if (!model.isMyChannel) {
    continue;
    }
    if ([model.name isEqualToString:@"推荐"]) {
    continue;
    }

          if (CGRectContainsPoint(model.frame,moveBtnCenter)) {
              locationBlock(model);
          }
      }
    

    });
    }

@yanchaoGan
Copy link
Author

加个continue 似乎就可以了??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants