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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:23:56+00:00 2026-05-23T15:23:56+00:00

I have did coding as in ViewDidLoad as below // Implement viewDidLoad to do

  • 0

I have did coding as in ViewDidLoad as below

    // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
    - (void)viewDidLoad {
    [super viewDidLoad];

    UIColor *colorOne = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
    UIColor *colorTwo = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];

   //Create the gradient and add it to our view's root layer
   CAGradientLayer *gradientLayer = [[[CAGradientLayer alloc] init] autorelease];
   gradientLayer.frame = CGRectMake(0.0, 0.0, 320.0, 480.0);
   [gradientLayer setColors:[NSArray arrayWithObjects:(id)colorOne.CGColor,    (id)colorTwo.CGColor, nil]];
   [self.view.layer insertSublayer:gradientLayer atIndex:0];

date1 = [[RRSGlowLabel alloc]     initWithFrame:CGRectMake(self.view.frame.size.width/2, self.view.frame.size.height/2, 300, 480)];
   [date1 setTextAlignment:UITextAlignmentCenter];
   date1.center = CGPointMake((self.view.frame.size.width/2)-20, (self.view.frame.size.height/2)-100);
   date1.textColor = [UIColor colorWithRed:0.0 green:1.0 blue:0.0 alpha:1.0];
   date1.font=[UIFont fontWithName:@"ds-digital" size:20.0];
    //[label sizeToFit];
   [date1 setBackgroundColor:[UIColor clearColor]];

   date1.glowOffset = CGSizeMake(0.0, 0.0);
   date1.glowColor = date1.textColor;
       date1.glowAmount = 120.0f;
  dateFormatter = [[NSDateFormatter alloc] init];
  [dateFormatter setTimeStyle:NSDateFormatterNoStyle];
   [dateFormatter setDateStyle:NSDateFormatterMediumStyle];
    [dateFormatter setTimeZone:[NSTimeZone localTimeZone]];
   currentDate = [NSDate date];
   //[dateFormatter setDateFormat:@"hh:mm"];
   NSString *date = [dateFormatter stringFromDate:currentDate];
   [self.date1 setText:date];   
   [self.view addSubview:date1];

   time = [[RRSGlowLabel alloc]     initWithFrame:CGRectMake(self.view.frame.size.width/2, self.view.frame.size.height/2, 300,  480)];
[time setTextAlignment:UITextAlignmentCenter];
time.center = CGPointMake((self.view.frame.size.width/2)-20, self.view.frame.size.height/2);
time.textColor = [UIColor colorWithRed:0.0 green:1.0 blue:0.0 alpha:1.0];
time.font=[UIFont fontWithName:@"ds-digital" size:80.0];
//[label sizeToFit];
[time setBackgroundColor:[UIColor clearColor]];

time.glowOffset = CGSizeMake(0.0, 0.0);
time.glowColor = time.textColor;
    time.glowAmount = 120.0f;
currentDate = [NSDate date];
[dateFormatter setDateFormat:@"hh:mm"];
date = [dateFormatter stringFromDate:currentDate];
[self.time setText:date];   
[self.view addSubview:time];



seconds = [[UILabel alloc] initWithFrame:CGRectMake(self.view.frame.size.width/2,     self.view.frame.size.height/2, 300, 480)];
[seconds setTextAlignment:UITextAlignmentCenter];
seconds.center = CGPointMake((self.view.frame.size.width/2)+105, (self.view.frame.size.height/2)+20);
seconds.textColor = [UIColor colorWithRed:0.0 green:1.0 blue:0.0 alpha:1.0];
seconds.font=[UIFont fontWithName:@"ds-digital" size:20.0];
currentDate = [NSDate date];
[dateFormatter setDateFormat:@"ss a"];
date = [dateFormatter stringFromDate:currentDate];
[seconds setText:date];
//[label sizeToFit];
[seconds setBackgroundColor:[UIColor clearColor]];
[self.view addSubview:seconds];

date = nil;
dateFormatter = nil;
currentDate = nil;

timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self    selector:@selector(updateTime) userInfo:nil repeats:YES];
 }

In simple it will display the current time with glow on it, well I want to know that how can I code while i want to rotate iphone, it should rotate with it …

  • 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-23T15:23:57+00:00Added an answer on May 23, 2026 at 3:23 pm

    To enable rotation you need to implement the following method in your view controller:

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        return YES;
    }
    

    …which would support all orientations. Note that on iPhone you may only want to support 3 (upside-down portrait is not typically supported on iPhone), so you can return YES or NO as appropriate.

    Once you’ve implemented that method your view controller should now rotate in response to orientation changes. However, your view may still need to resize.

    For this you can either use autoresizing masks on each view (to allow them to stretch/shrink or move as appropriate), or adjust their frames manually by implementing the willAnimateRotationToInterfaceOrientation:duration: method. The former is generally the better approach, although there will probably be some instances where you’ll need to manually adjust frames, or add/remove entire views if your interface substantially changes in landscape.

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

Sidebar

Related Questions

What issues or refactoring did you have to do when you upgraded from ASP.NET
After being troubled by an issue that I simply did not have the knowledge
Update: Ok, after getting past the fact that I did not have MSDTC set
I have Googled merge+cell+Javascript but did not find any suitable code to implement merge
I have been coding in python/django and c/c++ from last three years for various
Does anyone have any thoughts on this method? I have did some performance testing
Did not have luck with these examples: Javascript File remove Javascript FSO DeleteFile Method
I know it is a strange question did someone have had a case where
Did you ever have to choose between WISA or LAMP at the beginning of
I have a script that did double inserts into the database with the same

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.