1

I have a busy layout and I want all the information on the screen, but divided by the functional equivalent of <hr> in an HTML layout.

mobibob
  • 8,670
  • 20
  • 82
  • 131

1 Answers1

3

You can just use a 1px high UIView and set the background color to whatever you want.

Or the harder way using Core Graphics.

Community
  • 1
  • 1
Evan Mulawski
  • 54,662
  • 15
  • 117
  • 144
  • What if the UX reviewers want some border style? Is using a UITextField and disabling the user interaction too much of a hack? – mobibob Aug 22 '11 at 18:54
  • @mobibod: Not sure I understand. Are you suggesting using a UITextField for a separator? Also, if you have specific requirements, please include them in the question - you will get better answers this way. – Evan Mulawski Aug 22 '11 at 18:56
  • Sorry for the frustration - I thought the reference to
    in HTML would suffice. For example, it has many attributes for border style, etc. Unfortunately, I have vague requirements to begin with and I did not escape the
    , so instead I got an
    in my question. I will fix the description.
    – mobibob Aug 22 '11 at 20:20
  • @mobimob: (I knew it was a horizontal rule.) You can apply border styles to a `UIView` by accessing its `layer` property. See the docs on `CALayer`. – Evan Mulawski Aug 22 '11 at 20:21
  • Good point. I like that answer. I am using a UITextField and disabling the user interaction, making it really thin and no text. I prefer the UIView under this circumstance. – mobibob Aug 23 '11 at 18:26