Question

I've got an app where I allow the user to add events to a list. The method I use to do this is via a form that I show the user in a UIPopOver.

The form has the following components (in this order, top to bottom):

  1. Event Description Label (UILabel)
  2. Event Description (UITextField)
  3. Event Details Label (UILabel)
  4. Event Details (UITextView)
  5. Event Time Label (UILabel)
  6. Event Time (UIDatePicker)
  7. Save Event (Custom Button)
  8. Cancel (Custom Button)

I'd prefer not to show a screen shot since it's a sensitive app. :-)

So........

All is well when I first show the UIPopOver. Everything appears as I wish. The overall layout is about 650 pixels tall, which is just tall enough to take up pretty much the whole screen (vertically) when in landscape mode.

  • When the user tries to interact with the `UIDatePicker`, everything goes swimmingly (well).
  • When the user taps into the Event Description (`UITextField`) field, the keyboard appears and the `UIPopOver` shrinks so that basically the `UIDatePicker` and buttons are hidden. I consider this OK, since they re-appear when the keyboard is dismissed.
  • The problem I am having is when the user tries to interact with the `UITextView`:
    1. When the view of the `UIPopOver` has its `backgroundColor` property set to `[UIColor whiteColor]`, the `UITextView` initially appears with a thin black border. I like this.
    2. When the user taps in the `UITextView` to begin editing, the `UIPopOver` resizes to accommodate the keyboard and, during the transition, the black border "shrinks up" and disappears. This is in spite of my shocks and struts being set so that all dimensions/directions are fixed and it is "glued" to the top-left.
    3. Following this, when the user dismisses the keyboard, the border sort of restores itself to its previous position, but it now adds a thick black border on the bottom that completely obscures the label placed between the `UITextView` and the `UIDatePicker`.
    4. When I change the background of the view of the `UIPopOver` to "`ScrollView` Textured Background Color", the border "disappearing trick" is at least less noticeable, but the black border at the bottom (following keyboard dismissal) is still present.

Questions

  1. Has anyone encountered something like this before?
  2. Does anyone think it's just an IB error and that I need to re-build my XIB?
  3. Anybody got any other ideas? Googling for this issue came up fairly empty for me. If you think of better terms and find something, please let me know (gently).
Was it helpful?

Solution

Boy, I'm a stupid stupid!!! It turns out I had forgotten that I placed the UITextView inside of a UIView (inset 1 pixel on all sides) and set the background of the UIView to be black so that I could get a border effect on the UITextView. Once I remembered that, setting the shocks/struts of THAT UIView turned out to be the solution.

Sorry for wasting your time!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top