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

  • SEARCH
  • Home
  • 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 8384191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:20:49+00:00 2026-06-09T17:20:49+00:00

I have this problem driving me crazy. I have spent decades to figure it

  • 0

I have this problem driving me crazy. I have spent decades to figure it out why this is happening.

I have a UIScrollView as scrollView in a UIView. In this scrollView, i have three different UIViews which are created at runtime. In one of these three UIViews, i create a button .Here is my code to do that.

        UIButton *buttonLike = [UIButton buttonWithType:UIButtonTypeRoundedRect ] ;
        buttonLike.frame =CGRectMake(scrollViewWidth +200, 30,36, 16);
        buttonLike.imageView.image = [UIImage imageNamed:@"like.png"];
        [buttonLike addTarget:self action:@selector(buttonLikePressed:) forControlEvents:UIControlEventTouchUpInside] ;

scrollViewWidth is a constant defined and initialized as well.
And,i add this buttonLike as a subview in one of the UIViews. But,no matter what i do , buttonLikePressed method doesn’t invoke.
I’ve searched this issue and came up with these solutions.

Iphone UIButton not working in nested UIViews
iPhone SDK 2: UIButton not working in nested views loaded from nib file

They described the same issue. But,as a solution they initialize their views using
-(id)initWithFrame:(CGRect)aRect method. Well,i’ve already initialized my UIViews using initWithFramemethod. Do u guys have any idea how i can resolve this problem ?

Thank you all

  • 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-06-09T17:20:50+00:00Added an answer on June 9, 2026 at 5:20 pm

    Does your button even react to a touch? Does it highlight when pressed?

    Because it sounds like you are adding this button to a view outside of that view’s bounds which prevents touches being propagated to the button. You either have to increase that view’s width to scrollViewWidth + 200 + 36or more or you need to put the button inside view’s bounds. Show us how you create that view that you add a button to.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is driving me crazy. Very grateful if someone could help me out! Problem:
This problem is driving me crazy. I have the following code: 'unprotect sheet If.Range(Start).Row+1<.Range(End).Row
This problem is driving me crazy, I'm sure I'm missing something. I need to
This is driving me crazy! I have read at least 5 questions on here
I have a strange problem with sqlite which is driving me crazy. I have
I have the following problem in application express which is driving me crazy: I
This problem is driving me crazy because I am not sure why this just
This problem is driving me a bit crazy. The code seems to be segmentation
This is driving me crazy. I have a library I source from multiple scripts,
I have a problem that I really cannot figure out how to solve. I

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.