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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:39:35+00:00 2026-06-05T00:39:35+00:00

My code goes like this: – (void)viewDidLoad { [self setGridView]; } -(void)setGridView { CGRect

  • 0

My code goes like this:

- (void)viewDidLoad
{
  [self setGridView];
}
-(void)setGridView
{
  CGRect frame; 
  frame .origin.x=0;
  frame.origin.y=20;
  frame.size.width=GRID_WEIGHT;
  frame.size.height=GRID_HEIGHT;
  GridView *ObjGridView=[[GridView alloc]initWithFrame:frame]; 

  [[NSBundle mainBundle ] loadNibNamed:@"GridView" owner:ObjGridView options:nil];
  [ObjGridView setGridViewFrame:frame];

  [self.view addSubview:ObjGridView.GridCellView];
  frame .origin.x+=GRID_WEIGHT;
}

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

This code adds a subview to a view and sets the frame

My problem:
1-How do i refresh my view when Orientation(landscape or portrait) happens,
because i set the frame of subview in the lanscape mode and i wants to use the sane view in my portrait view also .(basically where do i call this -(void)setGridView delegate method)?

2-How do i know, my subview exceeding the bound of the view,so that i can handle the subview in my setGridView method ?

  • 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-05T00:39:37+00:00Added an answer on June 5, 2026 at 12:39 am

    1.Below method will call automatically whenever your orientation changes. Do the necessary changes according to each orientation.

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    
    if (interfaceOrientation == UIInterfaceOrientationPortrait) {}
    
    else if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {} 
    
    else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) {} 
    
    else if (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {}
    
    return YES;
    
    }
    

    2.You should know the width and height of your views and set the frames accordingly. That is not a big deal.

    Hope this is helpful.

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

Sidebar

Related Questions

My Code goes like this: using (StreamReader streamReader1 = new StreamReader(response.GetResponseStream())) { string resultString
Part of my code goes like this: while(1){ my $winmm = new Win32::MediaPlayer; $winmm->load('1.mp3');
I am using the ComboBox in LWUIT. My code goes like this. public Locations(String
I have a code that goes like this: jLabel.setIcon(map); Graphics2D g = (Graphics2D) jLabel.getGraphics();
In the UI thread I have a piece of code that goes like this:
I like my code formatted like this: WithDataContext.Execute( delegate(DataContext dataContext) { // code goes
Our projects in TFS are organized like this: $\DefaultCollection\ProjectName\Source <-- source code goes here
I have a bit of php code like this: $test = <!--my comment goes
I'm comparing two dates and my code goes like this. jQuery('.newAppointment a.ui-state-default').click(function() { var
I have a code snippet that goes like this: $('#content').css('padding-top', heightTwo + 44 +

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.