enter image description here我有定制的tableview细胞的底部设置一个总按钮,我想在的tableview的可点击的我有自定义的tableview细胞和我在的tableview
UIButton*yourBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[yourBtn setImage:[UIImage imageNamed:@"wishlist"] forState:UIControlStateNormal];
//[yourBtn setTitle:@"+" forState:UIControlStateNormal];
yourBtn.frame = CGRectMake(0, self.view.bounds.size.height -100, buttonwidth, buttonheight);
yourBtn.center = CGPointMake(self.view.center.x, self.view.bounds.size.height -100);
[yourBtn addTarget:self action:@selector(addButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:yourBtn];
底部设置一个整体的按钮
如果我滚动tableview中按钮也从顶部滚动bottom.i要设置按钮时不断滚动的tableview
如何获得这样
为什么你不使用故事板它更容易 –
你有没有尝试过把它添加为表格页脚? https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITableView_Class/index.html#//apple_ref/occ/instp/UITableView/tableFooterView – Losiowaty
试试这个[self.tableview addSubview:yourBtn]; – MuraliMohan