Re: scrolling woes

2017-05-20 Thread Quincey Morris
On May 20, 2017, at 12:01 , J.E. Schotsman  wrote:
> 
> I am happy with the result except that I cannot set the placeholder text now.

If the text is not editable, then a text view is a better choice than a text 
field, but it should probably be bordered and maybe have a different background 
color (otherwise how do users know there’s something to scroll?). However, you 
don’t need placeholder text in the sense of text that tells the user what to 
type. Instead, you should probably do what Apple does, e.g. in Xcode when you 
deselect everything in the project navigator on the left, it shows “No 
Selection” in the inspector panel on the right.

To do that, use a second view (a text field, probably) that’s constrained to 
the bounds of the text field’s visible extent. Center the placeholder text 
horizontally and vertically, and use a large font size. Then, when setting text 
into the text view, hide or show exactly one of the two views, as appropriate 
to the text.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: scrolling woes

2017-05-20 Thread J.E. Schotsman

> On 20 May 2017, at 19:11, Saagar Jha wrote:
> 
> 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.

Looks like I can't get the scrolling behaviour for free in this way as I was 
hoping.

>> 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?

The behaviour of a non-editable text field with the added property that it can 
be scrolled.
I used the inspector to disable most of the capabilities of the text view.
I am happy with the result except that I cannot set the placeholder text now.

Jan E.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: scrolling woes

2017-05-20 Thread J.E. Schotsman

> On 20 May 2017, at 20:02, Quincey Morris wrote:
> 
>> I had a text field within a tab view item whose text was getting too large.
> 
> Too large, as in: there are multiple lines of text whose total vertical 
> height exceeds the height of the text field?

Yes

> 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.
> 
> Well, no, of course not. A text field is a control, so you put the control in 
> a scroll view. The control itself isn’t bigger than the height available, 
> just the text within the control. Since the scroll bar acts on the control, 
> it doesn’t scroll the text.

So to make this work I would have to set the height of the text field equal to 
the height of the text every time I change the stringValue? Sounds like I need 
a text view instead to display a long non-editable text.

Jan E.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: scrolling woes

2017-05-20 Thread Quincey Morris
On May 20, 2017, at 06:00 , J.E. Schotsman  wrote:
> 
> I had a text field within a tab view item whose text was getting too large.

Too large, as in: there are multiple lines of text whose total vertical height 
exceeds the height of the text field?

> 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.

Well, no, of course not. A text field is a control, so you put the control in a 
scroll view. The control itself isn’t bigger than the height available, just 
the text within the control. Since the scroll bar acts on the control, it 
doesn’t scroll the text.

> Does this have to be so hard?

I went to a (macOS) test project, dragged an editable text field into the main 
window, and changed its Layout attribute from “scrolls” [== scrolls 
horizontally] to “wraps” [== scrolls vertically]. When I run the app and type 
more than one line of text, it scrolls down as I type enough text. If I use the 
up and down arrow keys to move around the text, it scrolls to keep the 
selection visible.

Certainly, there is no scroll bar, but in what sense doesn’t it scroll?
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: scrolling woes

2017-05-20 Thread Saagar Jha
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  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 (Cocoa-dev@lists.apple.com)
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/saagar%40saagarjha.com
> 
> This email sent to saa...@saagarjha.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

scrolling woes

2017-05-20 Thread J.E. Schotsman
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?

After a little googling I realised I could use a text view instead.
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.

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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Repository of older (outdated) PDF Guides?

2017-05-20 Thread Nimesh Neema
Amazing and neatly organised collection Kevin.

Thanks for sharing.

Nimesh

On 19 May 2017 at 22:17, Kevin Brock  wrote:

> I’ve got a collection here:
>
> https://www.dropbox.com/sh/dlhxh9birw1lhp9/AABA3_
> yvSRwjOBA84LxD3RzIa?dl=0
>
> Ranging from 2010-2014.
>
>
> Kevin
>
> > On May 11, 2017, at 00:32, Nimesh Neema  wrote:
> >
> > I have a few lying around here:
> >
> > https://www.dropbox.com/sh/h0h56lj0dky27m9/
> AADbwmnbhu8I6DRVldV8Lum0a?dl=0
> >
> > See if you find anything of use.
> >
> > Nimesh
> >
> > On 25 April 2017 at 23:50, David Hoerl  wrote:
> >
> >> I've googled til my fingers are black and blue, but no luck finding some
> >> of the older PDF guide documents. I could never express in words how
> >> disappointed I am that Apple discontinued producing readable
> documentation
> >> - I use to crow about it to all my non-Apple dev friends.
> >>
> >> Anyway, does anyone know of a place that stashed copies away? I'm fine
> >> with reading 5 year old documentation to get the big picture, then make
> >> annotations on paper copies, finally go online to see if anything of
> >> interest changed.
> >>
> >> Thanks for any pointers!
> >>
> >> David
> >>
> >> PS: https://forums.developer.apple.com/message/100458
> >>
> >> Note - I have some myself, but didn't keep them up to date so some way
> old
> >> (never thought they'd go away). Need one? Email me and I'll send if
> have it.
> >> ___
> >>
> >> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> >>
> >> 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:
> >> https://lists.apple.com/mailman/options/cocoa-dev/
> nimeshneema%40gmail.com
> >>
> >> This email sent to nimeshne...@gmail.com
> >>
> > ___
> >
> > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> >
> > 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:
> > https://lists.apple.com/mailman/options/cocoa-dev/apple%40kevin.com
> >
> > This email sent to ap...@kevin.com
>
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Button doesn't respond to touches in landscape mode

2017-05-20 Thread Alex Zavatone

On May 19, 2017, at 2:14 PM, Doug Hill wrote:

> in it's bounds t

In its* bounds

> When the device is in portrait mode, the button can be tapped anywhere in 
> it's bounds to send control messages. When I rotate the device to landscape 
> mode, I can only tap on a very small area on the top of the button. 
> Otherwise, taps are ignored.

> The button seems to layout with autolayout correctly, there are no autolayout 
> warnings in the storyboard or at runtime. View debugging doesn't show 
> anything weird about this button.

How is your button wired up?

What is its contentEdgeInsets?

If you override pointInside for the view of the button, what does it return 
when you tap on the button before and after rotating it??

http://stackoverflow.com/questions/17249104/how-to-increase-selection-area-of-uibutton

If you are using constraints, remove them and see if that affects the hit 
region.

After rotating, there is a button you can click in the debugger that can show 
your view hierarchy and you can inspect each element

While running from Xcode you can also display the view hierarchy of the view 
controller or the button with [myButton.view recursiveDescription]

This should help:

http://stackoverflow.com/questions/5150186/how-do-i-inspect-the-view-hierarchy-in-ios

Good luck.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com