美文网首页
UITableViewController怎么样添加一个固定的不

UITableViewController怎么样添加一个固定的不

作者: 雨后天_ | 来源:发表于2019-12-21 11:55 被阅读0次

    UITableView *tableView = (UITableView *)self.view;

    UIView *containerView = [[UIView alloc] initWithFrame:self.view.frame];

    tableView.frame= tableView.bounds;

    self.view= containerView;

    [containerViewaddSubview:tableView];

    self.buttonAdd = [UIButton buttonWithType:UIButtonTypeCustom];

    [self.buttonAdd setBackgroundImage:kGetImage(@"voice_add") forState:UIControlStateNormal];

    [self.buttonAdd setBackgroundImage:kGetImage(@"voice_add") forState:UIControlStateHighlighted];

    [self.buttonAdd addTarget:self action:@selector(addVoiceCmd) forControlEvents:UIControlEventTouchUpInside];

    [self.view addSubview:self.buttonAdd];

    [self.buttonAdd mas_makeConstraints:^(MASConstraintMaker *make) {

        make.right.equalTo(self.view).with.offset(-20);

        make.bottom.equalTo(self.view).with.offset(-60);

        make.width.mas_equalTo(90);

        make.height.equalTo(self.buttonAdd.mas_width).multipliedBy(1);

    }];

相关文章

网友评论

      本文标题:UITableViewController怎么样添加一个固定的不

      本文链接:https://www.haomeiwen.com/subject/bfqgnctx.html