title: how to display the UIButton and UITableview in ios6&ios7 for 4-inches screen and 3.5 inches screen
body: <p>I am developing an app. In the app I wrote the code for a 3.5-inches screen and 4-inches screen for ios7&amp;ios6. I took one view controller; in this view controller I want to display two images, one for the top and another for the bottom.And also display login and logout buttons and login Tableview. On the ios7&amp;ios6 3.5-inch screen and 4 inches screen there is no problem with the display the two images like Top image and Bottom image. The two images are  displayed properly.But button and UITableview not displayed.I cant understand where is the  problem for displaying UIButton and UITableview. Please give me ideas, anyone. I am new to programming. Thanks in advance.</p>
  
  <p>The below is my code.</p>
  
  <p>Viewcontroller.m (3.5 inches and 4-inches screen for ios7 &amp; ios6).</p>
  
  <pre><code> if ([[UIScreen mainScreen] bounds].size.height == 568)  
    {
  
     if ([[[UIDevice currentDevice] systemVersion] floatValue] &gt;= 7)
      {
  
       imgLogo=[[UIImageView alloc]initWithFrame:CGRectMake(75, 65, 162, 57)];
  
       imgBuilding=[[UIImageView alloc]initWithFrame:CGRectMake(8, 415, 300, 153 )];
  
       // Button Login for ios7 4-inches screen.
  
       btnLogin.frame = CGRectMake(20, 230, 127, 32);
  
       // Create Login for UITableview
  
       tableVw=[[UITableView alloc] initWithFrame:CGRectMake(0, 80, 320, 123) style:UITableViewStyleGrouped];
  
    }
  
    else
     {
  
     imgLogo=[[UIImageView alloc]initWithFrame:CGRectMake(75, 45, 162, 57)];
  
     imgBuilding=[[UIImageView alloc]initWithFrame:CGRectMake(8, 395, 300, 153 )];
  
     // Button Login for ios6 4-inches screen.
  
     btnLogin.frame = CGRectMake(20, 230, 127, 32);
  
     tableVw=[[UITableView alloc] initWithFrame:CGRectMake(0, 80, 320, 123) style:UITableViewStyleGrouped];
  
      }
  
     imgLogo.image=[UIImage imageNamed:@"Logo-01.png"];
  
     [self.view addSubview:imgLogo];
  
     imgBuilding.image=[UIImage imageNamed:@"image-02.png"];
  
     imgBuilding.alpha=0.4;      
  
     [self.view addSubview:imgBuilding];
  
     btnLogin = [UIButton buttonWithType:UIButtonTypeRoundedRect];
  
     [btnLogin addTarget:self action:@selector(login) forControlEvents:UIControlEventTouchDown];
  
     [btnLogin setBackgroundImage:[UIImage imageNamed:@"Sign-in-button.png"] forState:UIControlStateNormal];
  
     [self.view addSubview:btnLogin];
  
     // create Login tableview properties
  
     tableVw.dataSource = self;       
     tableVw.delegate = self;
  
     tableVw.backgroundColor=[UIColor clearColor];
  
     tableVw.scrollEnabled=NO;
  
     tableVw.scrollsToTop=NO;
  
     [self.view addSubview:tableVw];
  
   }
  </code></pre>
  
  <p>/<strong><em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**</strong>/
      /<strong><em>*</em></strong><em>3.5 inches screen for ios6 and ios7</em><strong><em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>***</strong>/</p>
  
  <p>/<strong><em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**</strong>/</p>
  
  <pre><code> else
   {
  
    if ([[[UIDevice currentDevice] systemVersion] floatValue] &gt;= 7)
     {
  
      imgLogo=[[UIImageView alloc]initWithFrame:CGRectMake(75, 70, 162, 57)];
  
      imgBuilding=[[UIImageView alloc]initWithFrame:CGRectMake(0, 345, 320,140 )];
  
      btnLogin.frame = CGRectMake(20, 200, 127, 32);
  
      // create Login Tableview
  
      tableVw=[[UITableView alloc] initWithFrame:CGRectMake(10, 85, 300, 123) style:UITableViewStyleGrouped];
  
     }
  
     else
     {
  
      imgLogo=[[UIImageView alloc]initWithFrame:CGRectMake(75, 50, 162, 57)];
  
      imgBuilding=[[UIImageView alloc]initWithFrame:CGRectMake(0, 325, 320,140 )];
  
      btnLogin.frame = CGRectMake(20, 200, 127, 32);
  
      tableVw=[[UITableView alloc] initWithFrame:CGRectMake(10, 85, 300, 123) style:UITableViewStyleGrouped];
  
     }
  
     imgLogo.image=[UIImage imageNamed:@"Logo-01.png"];
  
     [self.view addSubview:imgLogo];
  
     imgBuilding.image=[UIImage imageNamed:@"image-02.png"];
  
     imgBuilding.alpha=0.4;
  
     [self.view addSubview:imgBuilding];
  
     // Create Button Properties
  
     btnLogin = [UIButton buttonWithType:UIButtonTypeRoundedRect];
  
     [btnLogin addTarget:self action:@selector(login) forControlEvents:UIControlEventTouchDown];
  
     [btnLogin setBackgroundImage:[UIImage imageNamed:@"Sign-in-button.png"] forState:UIControlStateNormal];
  
     [self.view addSubview:btnLogin];
  
     // Create Login Tableview properties
  
     tableVw.dataSource = self;     
     tableVw.delegate = self;
  
     tableVw.backgroundColor=[UIColor clearColor];
  
     tableVw.scrollEnabled=NO;
  
     tableVw.scrollsToTop=NO;
  
     [self.view addSubview:tableVw];
  
  
     }
  
    }
  </code></pre>