Giter Site home page Giter Site logo

单独使用WMZPageView + 使用UIView作为底部视图 悬停效果 ,view内的滚动视图上下滚动会影响 总体滚动 about wmzpagecontroller HOT 2 OPEN

Lpkiki avatar Lpkiki commented on June 14, 2024
单独使用WMZPageView + 使用UIView作为底部视图 悬停效果 ,view内的滚动视图上下滚动会影响 总体滚动

from wmzpagecontroller.

Comments (2)

wwmz avatar wwmz commented on June 14, 2024

需要加入 在VC中加入 [self.pageView performSelector:@selector(scrollViewDidScroll:) withObject:scrollView]; 解决问题(参考的WMZPageController)

大佬是不是我用的不对 ,你看下代码

`- (void)viewDidLoad { [super viewDidLoad];

WMZPageParam *param = PageParam()
.wMenuHeadViewSet(^UIView *{
    UIImageView *image = [UIImageView new];
    [image sd_setImageWithURL:[NSURL URLWithString:@"https://upload-images.jianshu.io/upload_images/9163368-02e26751674a3bc6.jpeg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"]];
    image.frame = CGRectMake(0, 0, PageVCWidth, 300);
    return image;
})


.wTitleArrSet(@[@"精选",@"好货",@"精选",@"好货"])
.wViewControllerSet(^UIViewController * _Nullable(NSInteger index) {

// return NSClassFromString(@"TopSuspensionVC").new; /// 带滚动视图需实现协议 TopSuspensionView *view = TopSuspensionView.new;

    view.page = index;
    /// 这里为了方便使用 使用同一个属性 所以这里为了去除警告强转一下类型 但是实际类型还是UIView
    return (UIViewController*)view;
})


.wTopSuspensionSet(YES)

// .wMenuHeightSet(50)

// .wTopSuspensionSet(YES) // //No为从自定义导航栏顶部开始 yes为从自定义导航栏底部开始 // // .wFromNaviSet(NO) // //顶部可下拉 // // .wBouncesSet(NO)

;

/// frame可以设置任意frame autoFix为YES
self.pageView = [[WMZPageView alloc]initWithFrame:CGRectMake(0, 100, self.view.bounds.size.width, self.view.bounds.size.height - 200) autoFix:NO param:param parentReponder:self];
self.pageView.downSc.dataSource = self ;
self.pageView.downSc.delegate = self ;
[self.view addSubview:self.pageView];


param.wEventClickSet(^(id  _Nullable anyID, NSInteger index) {
    NSLog(@"%@ %ld",self.pageView.upSc.currentVC,self.pageView.upSc.currentTitleIndex);
});


/// autoFix为NO 自己调整frame

// WMZPageView *pageView = [[WMZPageView alloc]initWithFrame:CGRectMake(0, 0, PageVCWidth, PageVCHeight - PageVCNavBarHeight) autoFix:NO param:param parentReponder:self]; // [self.view addSubview:pageView]; }

  • (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {
    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"];
    }
    cell.textLabel.text = @"自定义视图";
    cell.detailTextLabel.text = @"自定义cell";
    return cell;
    }
  • (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 100;
    }
  • (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 4;
    }

//注释这段代码会出现 滚动冲突

  • (void)scrollViewDidScroll:(UIScrollView *)scrollView{
    [self.pageView performSelector:@selector(scrollViewDidScroll:) withObject:scrollView];
    }

`

没看出什么 是什么问题

from wmzpagecontroller.

Lpkiki avatar Lpkiki commented on June 14, 2024

就是 不在VC 里写上
(void)scrollViewDidScroll:(UIScrollView *)scrollView{
[self.pageView performSelector:@selector(scrollViewDidScroll:) withObject:scrollView];
}
这段代码,
view内的tableview 滚动 会 带着 vc 里的tableview 一起滚动

from wmzpagecontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.