Tag: UITableViewUIBUTTON

如何检查UITableview中的UIButtons的条件

我在表格视图中有三个button图像,我想检查它们之间的条件。 当我点击button1意味着背景图像变成蓝色。 同时我点击button1将移动到正常状态的白色。 相同的另外两个button。 – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath![button3 condition][3] { static NSString *cellIdentifier = @"HistoryCell"; CustomizedCellView *cell = (CustomizedCellView *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if (cell == nil) { cell = [[CustomizedCellView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; } UIButton *button1; button1 = [UIButton buttonWithType:UIButtonTypeCustom]; button1.frame = CGRectMake(80, 27, 36, 36); [button1 setImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"l"ofType:@"png"]] forState:UIControlStateNormal]; button1.tag = […]

如何把一个静态的UIButton覆盖一个UITableView

基本上,我想创build一个静态的UIButton,无论是否滚动表视图。 但是,我试图添加UIButton作为UIView的子视图,并使用“bringSubviewToFront”方法在顶部。 但是,当我滚动UITableView UIButton仍然移动。 因此,我怎样才能使一个静态的UIButton覆盖UITableView? 这是我的代码: #import "DiscoverTimelineTableViewController.h" @interface DiscoverTimelineTableViewController () @property (strong, nonatomic) UIView* myview; @end @implementation DiscoverTimelineTableViewController – (void)viewDidLoad { [super viewDidLoad]; [self displayMakePlanButton]; NSLog(@"%f", self.view.layer.zPosition); NSLog(@"%f", self.tableView.layer.zPosition); } – (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } #pragma mark – Table view data source – (NSInteger)numberOfSectionsInTableView:(UITableView […]