Note that there are some explanatory texts on larger screens.

plurals
  1. POPlace UIView on top of all other views
    primarykey
    data
    text
    <p>Can someone help me on how to make make UIView created in code to be on top of all other view? where tableView is the parent view and the subSelectionView is my custom siblings view, I want to make it on top of the tableView.. I have this code below:</p> <p>This is the full source code for my didSelectRowAtIndexPath:, from where I programmatically add UIView instance..</p> <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // Execute upon selection [tableView deselectRowAtIndexPath:indexPath animated:YES]; [[tableView viewWithTag:199]removeFromSuperview]; // Get the cell size CGSize cellSize = [tableView cellForRowAtIndexPath:indexPath].frame.size; // Contact Details Container UIView *subSelectionView; if(indexPath.row &lt; [contacts count] - 6) subSelectionView = [[UIView alloc]initWithFrame:CGRectMake(10, 0, (int)cellSize.width - 20, (int)cellSize.height + 130)]; subSelectionView.backgroundColor = [UIColor grayColor]; subSelectionView.layer.borderColor = [UIColor grayColor].CGColor; subSelectionView.layer.borderWidth = 1; subSelectionView.alpha = 0.9; subSelectionView.tag = 199; subSelectionView.layer.cornerRadius = 5.0; // Contact Name Container UIView *contactNameSubSelectionView; if(indexPath.row &lt; [contacts count] - 6) contactNameSubSelectionView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, (int)cellSize.width - 20, (int)cellSize.height)]; contactNameSubSelectionView.backgroundColor = [UIColor grayColor]; contactNameSubSelectionView.alpha = 0.5; [subSelectionView addSubview:contactNameSubSelectionView]; // Contact Name Label Contacts *contact = [self.contacts objectAtIndex:indexPath.row]; NSString *contactName = [NSString stringWithFormat:@" %@ %@ ", contact.fname, contact.lname]; UILabel *contactNameLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, (int)cellSize.width, (int)cellSize.height)]; contactNameLabel.layer.cornerRadius = 4.0; [contactNameLabel setText: contactName]; [contactNameLabel setTextColor:[UIColor blackColor]]; [contactNameLabel setFont:[UIFont boldSystemFontOfSize:[UIFont systemFontSize]]]; [contactNameSubSelectionView addSubview:(UIView *)contactNameLabel]; // Buttons UIButton *buttonMobile = [[UIButton alloc]initWithFrame:CGRectMake(10, cellSize.height + 10, 30, 30)]; buttonMobile.layer.borderWidth = 1; [buttonMobile setTitle:@"..." forState:UIControlStateNormal]; [buttonMobile addTarget:self action:@selector(btPressed:) forControlEvents:UIControlStateNormal]; [subSelectionView addSubview:(UIView *) buttonMobile]; [[tableView cellForRowAtIndexPath:indexPath]insertSubview:subSelectionView aboveSubview:self.view]; [self.parentViewController.view bringSubviewToFront:subSelectionView]; [tableView reloadData]; } </code></pre> <p>but does not work..</p> <p>The image below shows my subSelectionView, the button is within it and the subSelectionView is within the tableView. Now, when I clicked that button, the problem is that I can't actually click it. It focuses directly to the tableView even with the presence of my codes. Can someone help me please?....</p> <p><img src="https://i.stack.imgur.com/dBhD2.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload