Re: scrolling woes
Re: scrolling woes
- Subject: Re: scrolling woes
- From: Saagar Jha <email@hidden>
- Date: Sat, 20 May 2017 10:11:44 -0700
I haven’t seen your xib files, so this is just a guess, but here it goes:
Saagar Jha
> On May 20, 2017, at 06:00, J.E. Schotsman <email@hidden> wrote:
>
> Hello,
>
> I had a text field within a tab view item whose text was getting too large.
> So I embedded it in a scroll view. No matter what I tried in the xib editor, I couldn't get the scrolling to work.
> Does this have to be so hard?
Scroll views are dependent on the content size of their subviews. This can be done
by setting unambiguous constraints to the margins of the scroll view
by manually setting the contentSize of the scroll view.
If you don’t do either of these, the scroll view won’t work.
>
> After a little googling I realised I could use a text view instead.
Yes, you probably should.
> So I dumbed down the text view to a text field with vertical scroll bar in the xib.
> After setting the scroller enabled (why would you want a scroll bar that is visible, yet not enabled?) it started to work.
Wait, what? How did you “dumb” down the text view? Did you start deleting components? In general, this isn’t what you want to do; you can control whether the scroll bars are shown through code or the inspector on the right side. What behavior are you trying to achieve?
>
> This is a reasonable workaround except that now I have no placeholder value (would have to code that myself) and I noticed a curious bug in the text field (which would probably happen in an embedded text field as well):
>
> Suppose I have three options for the text, one lets the scroll bar autohide, the second text is too large, the third text barely fits if the scroll bar is hidden. Now the look of the third text depends on the previous value: it can show without the scroll bar being visible, or it can show with the scroll bar.
>
> Jan E.
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden