Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6129773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:46:53+00:00 2026-05-23T16:46:53+00:00

I have a view consisting of a label and two buttons, which I named

  • 0

I have a view consisting of a label and two buttons, which I named UIView *footerView, as I am implementing this in the last section of my table view. I have this view become the view for indexPath.section = 3 by using [cell.contentView addSubview: footerView]

This is my Problem:

I can see the view inside the cell. But I cannot tap the buttons, as the cell gets selected instead of the buttons (which are inside the cells).

How do I get over this problem? My buttons are not even selectable!

Here’s the code… In cellForRowAtIndexPath:

if (section == 3){

    cell = nil;
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];

    if (indexPath.row ==0){

        cell.contentMode = UIViewContentModeScaleToFill;
        [cell.contentView addSubview:self.footerView];

    }

}

And the Footer view (in case anyone needs to see this):

 UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0, 3, 300, 44)];
textView.text = @"Terms and Conditions: Lorem ipsum dolor sit amet, con- sectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut";

textView.backgroundColor = [UIColor clearColor];
textView.font = [UIFont systemFontOfSize:10];

[self.footerView addSubview:textView];

//create the button
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];

[button setFrame:CGRectMake(0, 60, 300, 44)];

//set title, font size and font color
[button setTitle:@"Create Account" forState:UIControlStateNormal];
[button.titleLabel setFont:[UIFont boldSystemFontOfSize:18]];
// [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];

//set action of the button
[button addTarget:self action:@selector(createAccount:)
 forControlEvents:UIControlEventTouchUpInside];

[button setEnabled:YES];
//add the button to the view
[self.footerView addSubview:button];


UIButton *cancelButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];

[cancelButton setFrame:CGRectMake(0, 107, 300, 44)];

//set title, font size and font color
[cancelButton setTitle:@"Cancel" forState:UIControlStateNormal];
[cancelButton.titleLabel setFont:[UIFont boldSystemFontOfSize:18]];
// [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];

//set action of the button
[cancelButton addTarget:self action:@selector(cancelPressed:)
       forControlEvents:UIControlEventTouchUpInside];


[cancelButton setEnabled:YES];
//add the button to the view
[self.footerView addSubview:cancelButton];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:46:54+00:00Added an answer on May 23, 2026 at 4:46 pm

    You will need to implement something similar to this

    - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        if (3 == indexPath.section){
          return nil;
        }
        return indexPath;
    }
    

    Ok so if I implement the above it works fine. I believe I can reproduce your issue by making the UIButton frame fall outside the cell’s contentView. Make sure the cell is big enough to contain your label and it should function correctly. To make the cell larger to fit your content you may have to implement:

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    {
      return aHeightThatIsBigEnoughToContainMySubViews;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application with a view-based NSTableView in it. Inside this table view,
I have a view consisting of 2 natural joins over the id field which
I have a simple mvc project consisting of one table named Persons and that
I have a table view(HomeViewController) consisting of items as: locations Reporting Setting I am
I have a table view consisting of lots of fields, divided into sections, with
I have created a simple view consisting of 3 tables in SQL. By right
I have view on which I defined a custom tagName. I need to be
I have view controller, into the view i have put a table view, and
i have view controller which contains a button which show the image library ,if
I have a TableLayout consisting of some buttons. I want to draw a rectangle

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.