title: UITextField Only Top And Bottom Border
body: <p>I currently have a regular border. I would like to <strong>only have a top and bottom border</strong>.</p>
  
  <p>How do I accomplish this?</p>
  
  <p>Using the <code>UITextField</code>'s <code>layer</code> property, I have the following code:</p>
  
  <pre><code>    self.layer.borderColor = [[UIColor colorWithRed:160/255.0f green:160/255.0f blue:160/255.0f alpha:1.0f] CGColor];
      self.layer.borderWidth = 4.0f;
  </code></pre>
  
  <p>I have kind of got it to work by <strong>making my UITextField extra long</strong>, so that the user does not see the left and right borders, but I was just wondering if there was a better, less hackish way of doing this?</p>
  
  <p>I have <strong>checked the docs</strong>, and changing a <code>UITextField</code>'s <code>borderStyle</code> does not have this option.</p>
  
  <p>From,</p>
  
  <p>An iOS First Timer</p>