title: UIView bottom border?
body: <p>To a <code>UIScrollView *toScrollView</code> (which is the width of the screen), I want to add a gray bottom border (exactly like that of the to-field of the compose view of the iPhone's native Messages app).</p>
  
  <p>To achieve this, I followed <a href="https://stackoverflow.com/questions/3330378/cocoa-touch-how-to-change-uiviews-border-color-and-thickness/3330397#3330397">Cocoa Touch: How To Change UIView&#39;s Border Color And Thickness?</a> and just covered the top border with  the custom <code>UINavigationBar</code> and made the <code>toScrollView</code>'s x-coordinate -1 &amp; width 322 so that the left &amp; right borders are just off screen.</p>
  
  <p>This looks fine, but it's sort of a hack, and I was wondering if there's a better way to do this.</p>
  
  <pre><code>- (void)viewDidLoad {
      [super viewDidLoad];
  
      // Add UINavigationBar *navigationBar at top.
      self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]
                                               initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
                                               target:self action:@selector(cancelAction)];
      UINavigationBar *navigationBar = [[UINavigationBar alloc]
                                        initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 44.0f)];
      navigationBar.items = [NSArray arrayWithObject:self.navigationItem];
  
      // Add UIScrollView *toScrollView below navigationBar.
      UIScrollView *toScrollView = [[UIScrollView alloc]
                                    initWithFrame:CGRectMake(-1.0f, 43.0f, 322.0f, 45.0f)];
      toScrollView.backgroundColor = [UIColor whiteColor];
      toScrollView.layer.borderColor = [UIColor colorWithWhite:0.8f alpha:1.0f].CGColor;
      toScrollView.layer.borderWidth = 1.0f;
      [self.view addSubview:toScrollView];
      [self.view addSubview:navigationBar]; // covers top of toScrollView
  }
  </code></pre>