title: How to set line under UITabBarItem dynamically
body: <p>Here i want to show a line below the tabBarItem like shown in the below image <a href="https://i.stack.imgur.com/LJfzB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LJfzB.png" alt="enter image description here"></a> and i am setting it in a following way. However the problem is it is static one and if i use the bigger screen size like iPhone 6 plus the paintView2 moves and looks ugly. So, how to set the CGRectMake co-ordinates of view dynamically for all screen sizes. Have tried in many ways but couldn't achieve what i wanted.</p>
  
  <p><a href="https://i.stack.imgur.com/7IwrW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7IwrW.png" alt="enter image description here"></a></p>
  
  <pre><code>    paintView2=[[UIView alloc]initWithFrame:CGRectMake(105,662,70, 5)];
  
  
      NSLog(@"position:%f",paintView2.frame.origin.x);
  
      CAGradientLayer *gradient = [CAGradientLayer layer];
  
      gradient.colors = [NSArray arrayWithObjects:(id)[self colorWithHexString:@"34A9C4"].CGColor,(id)[self colorWithHexString:@"36AC60"].CGColor, nil];
      gradient.frame = paintView2.bounds ;
      [paintView2.layer insertSublayer:gradient atIndex:0];
  
      [self.view addSubview:paintView2];
  </code></pre>