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 6990097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:18:07+00:00 2026-05-27T19:18:07+00:00

Thank you for looking, I try to implement in the super view (view controller)

  • 0

Thank you for looking, I try to implement in the super view (view controller) a custom view I created.

fromAge = [[simpleFormCell alloc]initWithFrame:CGRectMake(0, spaceFromTopLabel + 190, 200, 30)];
fromAge.title = @"Age";
fromAge.placeholder = @"";
fromAge.widthOfTextField = 60; 
[fromAge populateView];
fromAge.textField.delegate = self;
fromAge.textField.tag = fromAgeTextFieldTag;
[fromAge.textField setInputView:multipurposePicker];
[scrollViewBackground addSubview:fromAge];

toAge = [[simpleFormCell alloc]initWithFrame:CGRectMake(0, spaceFromTopLabel + 190, 200, 30)];
toAge.title = @"to";
toAge.placeholder = @"";
toAge.widthOfTextField = 60; 
toAge.leftPaddingForLabel = 210;
toAge.leftPaddingForTextField = 240;
[toAge populateView];
toAge.textField.delegate = self;
toAge.textField.tag = toAgeTextFieldTag;
[toAge.textField setInputView:multipurposePicker];
[scrollViewBackground addSubview:toAge];

simpleFormCell is a custom view with the following implementation:

- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
    title = @"test";
    placeholder = @"test2";
    numberofLine = 1;
    leftPaddingForLabel = 20;
    leftPaddingForTextField = 140;
    widthOfLabel = 90;
    widthOfTextField = 160;
    height = 30;
    //[self populateView];
}
return self;
}

- (void)populateView{
label = [[UILabel alloc]initWithFrame:CGRectMake(leftPaddingForLabel, 0, widthOfLabel, (height * numberofLine))];
label.text = title;
label.textAlignment = UITextAlignmentLeft;
label.backgroundColor = [UIColor clearColor];
[self addSubview:label];

textField = [[UITextField alloc]initWithFrame:CGRectMake(leftPaddingForTextField, 0, widthOfTextField, (height * numberofLine))];
textField.borderStyle = UITextBorderStyleRoundedRect;
textField.placeholder = placeholder;
textField.textAlignment = UITextAlignmentCenter;
textField.tag = tag;
[textField setReturnKeyType:UIReturnKeyNext];
[self addSubview:textField];
}

I have a similar method that called [self populateView] in the init. That seems to work fine. Please assume that multipurposePicker is working correctly. This is the code but wont apply to these two instances.

- (id)initWithPreset1:(CGRect)frame title:(NSString *)titleValue numberOfLine:(int)numberOfLineValue delegate:(id) delegateValue  tag:(int)tagValue{
self = [super initWithFrame:frame];
if (self) {
    title = titleValue;
    placeholder = @"";
    numberofLine = numberOfLineValue;
    leftPaddingForLabel = 20;
    leftPaddingForTextField = 140;
    widthOfLabel = 110;
    widthOfTextField = 160;
    height = 30;
    tag = tagValue;
    [self populateView];
    textField.delegate = delegateValue;
}
return self;
}

These white boxes wont respond to my touch. (textFieldDidBeginEditing wont fire).

enter image description here

[fromAge becomeFirstResponder] works. It just wont respond to my touch. I made sure that there is nothing on top of it. Please help. Thank you!

  • 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-27T19:18:07+00:00Added an answer on May 27, 2026 at 7:18 pm

    I found the problem! Anna Karenina’s comment guided me to the right solution. This has nothing to do with view hierarchy as I first thought. What happened was toAge was blocking fromAge. This makes fromAge textfield non-responsive. As per Anna’s comment, eventhough toAge textfield was shown, it was out of the view that supports it. This prevents it from accepting any touches. Thus neither boxes receive any touches. Thank you Anna!

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

Sidebar

Related Questions

I am looking to try and implement a project management system for myself that
thank you for looking i got this example from my book but i cant
Thank you for the answers. :) I'm mainly looking to host my website with
We are looking to implement Optimistic locking in our WCF/WPF application. So far the
I'm looking for a platform for showing custom maps on android mobile phones and
I was looking at this question: How to implement multiplication without using multiplication operator
I've got an MVC application where I use Try-Catch blocks throughout and I'm looking
I'm trying to implement a custom MapView. Inside my MapActivity (named mainmap) I have
Thanks for looking. All sincerely helpful answers are voted up. I use a password
Thanks for looking, all helpful answers are voted up. This is my markup. I'm

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.