ios - Making a UITextView work inside a UIStackView -


i'm trying add uitextviews uistackview , text views aren't showing up. i've researched issue , #1 answer found make uitextviews.enablescrolling set false. however, when that, text view becomes long. goes off view controller , uistackview becomes wide , goes off beyond edge of view controller. (and true) other content in uistackview disappears. think pretty strange.

this vertical stack view, way. wish better understood why uistackview behaving way. ideas on how stack view behave expected appreciated. way, uitextviews not editable , don't have respond user interaction. below storyboard , stack settings.

view controller stack settings

at point there no constraints being used stack view or contents. i've updated spacing between items 8, makes no difference- i've tried numbers 0-8 , uitextviews don't appear value. otherwise, i've left uistackview values alone.

i don't have enough rep comment, here's suggest: within stack view, can explicitly set constraints each object in stack view. try setting height constraints & width (using pin sides, or explicit width) each object knows how distributed.

from https://developer.apple.com/documentation/uikit/uistackview:

for distributions except fillequally distribution, stack view uses each arranged view’s intrinsiccontentsize property when calculating size along stack’s axis.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -