aaronfalls
aaronfalls

Reputation: 201

Interface Builder UIButton inside of UITextView

I want to build an interface that has scrolling text inside a UITextView, and a basic round rect button at the end of the text. The placement of the button will be dynamic, depending on the length of the text in the textView My view hierarchy is like this:

When I try to add a Round Rect Button to the textView in Interface Builder, it replaces it. Is it correct to add a UIButton as a subview of the UITextView, or should I be doing something else?

Upvotes: 1

Views: 726

Answers (1)

fatuous.logic
fatuous.logic

Reputation: 750

I would take a slightly different approach.

  • View Controller
    • UIView (The holder)
      • Text View (subview index 0)
      • UIButton (subview index 1)

then set the buttons position to whatever you need based on the text fields width still.

Upvotes: 1

Related Questions