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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:53:20+00:00 2026-05-30T11:53:20+00:00

In my app for iPhone/iPad (in Objective-C), there are some UITextFields which I am

  • 0

In my app for iPhone/iPad (in Objective-C), there are some UITextFields which I am adding progrmatically and these further added to array.

I want to set the hidden property on some button click (where I found the particular UITextField by traversing the array).

When I set the textfilled.hidden = true (at button click event), then it is not hidden instead in disabled mode and if I again set textfilled.hidden = false, then it enables.

I have tried changing other properties like text, background color etc. at the same level all works fine except the hidden property.

Note: If it set textfilled.hidden = true after adding the text field (with the same object of UITextField) then it hides perfectly.

UPDATE: I have used the following code:

UITextField *textField=[[[UITextField alloc] initWithFrame:CGRectMake(lastPoint.x, lastPoint.y, 60, 20)] autorelease];
    textField.backgroundColor=[UIColor greenColor];    
    textField.textColor=[UIColor blackColor];
    [textField addTarget:self action:@selector(handleEnterPressed:) forControlEvents:UIControlEventEditingDidEndOnExit];
    [capturedImage addSubview:textField];
    [noteTextArray addObject:textField];

In this I am creating a UITextField and adding it to array(noteTextArray) and the calling the .hidden property here:

-(void)handleEnterPressed:(UITextField *)textField 
{
for(UITextField *noteText in noteTextArray)
{
    if(noteText.tag==textField.tag)
    {
        noteText.backgroundColor=[UIColor purpleColor];
        noteText.text=@"Hi";
        noteText.hidden=true;
    }
}
}

But it is not hiding the text field.

Please let me know if somebody has any idea or solution.

UPDATE 1: Image has been taken by capturing the screenshot of current view of WebView

 UIGraphicsBeginImageContextWithOptions(webview.frame.size,NO,0.0);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetInterpolationQuality(context, kCGInterpolationHigh);
    [webview.layer renderInContext: context];
    capturedImage.image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();    

And the image further added to uiscrollviewer:

 scrollViewer.delegate=self;    
        scrollViewer.contentOffset = CGPointZero;
        capturedImage.contentMode= UIViewContentModeScaleAspectFit;
        scrollViewer.userInteractionEnabled=true;
        scrollViewer.contentMode= UIViewContentModeScaleAspectFit;
        scrollViewer.scrollEnabled=YES;
        [scrollViewer setBouncesZoom:YES];
        scrollViewer.clipsToBounds= YES;
        scrollViewer.contentSize = capturedImage.image.size;
        scrollViewer.minimumZoomScale=0.1;
        scrollViewer.maximumZoomScale=5.0;
        scrollViewer.zoomScale=0.5;
        if(capturedImage.superview != scrollViewer)
        {
            [scrollViewer addSubview:capturedImage];
        }
  • 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-30T11:53:21+00:00Added an answer on May 30, 2026 at 11:53 am

    Property cannot set as active and deactivate so This will be better approach if u set the property according to the situation like on button 1 pressed

    textField.textAlignment = UITextAlignmentCenter;
    

    and on button pressed

    textField.textAlignment = UITextAlignmentLeft;
    

    update:

       field.selected = TRUE;
    
        if([field isHidden])
    {
        [field setHidden:FALSE];
    }
    else  
    {
        [field setHidden:TRUE];
    }
    

    Update 2:

    - (void)viewDidLoad 
    {
        [super viewDidLoad];
    
        field = [[UITextField alloc] initWithFrame:CGRectMake(120, 20, 150, 20)];
        [self.view addSubview:field];
        field.placeholder = @"placeholder";
        field.backgroundColor = [UIColor redColor];
        field.textColor = [UIColor whiteColor];
    
    }
    
    -(IBAction) btnPressed:(id)sender
    {
    
        field.selected = TRUE;
    
            if([field isHidden])
        {
            [field setHidden:FALSE];
        }
        else  
        {
            [field setHidden:TRUE];
        }
    
    
    }
    

    update 3: please download the sample code (testTextField)

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

Sidebar

Related Questions

In my app for iPhone/iPad (in Objective-C), there are some UiButton's and other events
I have a Universal app (iPhone/iPad) which is very basic. There is a List
I am developing an app for iphone/ipad that I have some problems with. I
I have an iPhone/iPad app which uses Core Data. In my DB I have
I'm working on an iPhone-iPad app with Objective-C. I need to get the Bonjour
I have an iPhone/iPad app that I want to port to MacOSX. Most of
I am developing an app for iPhone/iPad using Objective C. In my app I
I have a Universal app (iPhone/iPad) which has an iAd displayed at the bottom
I have a Universal app (iPhone/iPad) testing on IOS4.3. It has an iAd which
I developed some app for iPhone/iPad, so I know the basic concepts of Cocoa

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.