Re: iOS 8 beta 4 messes with my TextView

2014-07-31 Thread Uli Kusterer
On 30 Jul 2014, at 04:55, Gerriet M. Denkmann gerr...@mdenkmann.de wrote:
 On 29 Jul 2014, at 22:06, Kyle Sluder k...@ksluder.com wrote:
 
 On Jul 29, 2014, at 1:58 AM, Gerriet M. Denkmann gerr...@mdenkmann.de 
 wrote:
 
 Master Detail app, works fine in 7.1.2.
 The Detail View has a UITextView.
 Whenever I get a Keyboard Notification (Changed) I change the height of the 
 TextView accordingly.
 
 All would be fine; but after all Notifications have been delivered and 
 before I can start typing, some evil agent resets the height of my TextView 
 back to the old (and now, with a keyboard present, much too big) value.
 
 
 Any known work-arounds?
 
 You probably shouldn't be changing the frame of your text view. Rather, set 
 its contentInset.
 
 You are right (as was Scott, when he suggested that there was a tug of war 
 between me and auto-layout).

 In general, whenever you use auto layout, you should stop changing frames 
directly. AutoLayout assumes it is the only one changing frames. You may have 
gotten away lucky so far, but whatever causes a re-layout (e.g. a return to 
the phone call bar popping up) could undo your frame change. You should 
*always* modify the constraints, intrinsic sizes etc. on an object instead of 
the frame when using auto-layout.

Cheers,
-- Uli Kusterer
The Witnesses of TeachText are everywhere...
http://www.zathras.de


___

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

iOS 8 beta 4 messes with my TextView

2014-07-29 Thread Gerriet M. Denkmann
Master Detail app, works fine in 7.1.2.
The Detail View has a UITextView.
Whenever I get a Keyboard Notification (Changed) I change the height of the 
TextView accordingly.

All would be fine; but after all Notifications have been delivered and before I 
can start typing, some evil agent resets the height of my TextView back to the 
old (and now, with a keyboard present, much too big) value.

Any ideas who would do such a thing to me?
Any known work-arounds?

Gerriet.


___

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: iOS 8 beta 4 messes with my TextView

2014-07-29 Thread Kyle Sluder
On Jul 29, 2014, at 1:58 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote:
 
 Master Detail app, works fine in 7.1.2.
 The Detail View has a UITextView.
 Whenever I get a Keyboard Notification (Changed) I change the height of the 
 TextView accordingly.
 
 All would be fine; but after all Notifications have been delivered and before 
 I can start typing, some evil agent resets the height of my TextView back to 
 the old (and now, with a keyboard present, much too big) value.
 
 Any ideas who would do such a thing to me?

You can answer this question yourself. Subclass UITextView, override 
-setFrame:, and set a breakpoint.

 Any known work-arounds?

You probably shouldn't be changing the frame of your text view. Rather, set its 
contentInset.

--Kyle Sluder
___

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: iOS 8 beta 4 messes with my TextView

2014-07-29 Thread Scott Andrew
You can also change the constraint. It sounds like you vs auto-layout. 

Sent from my iPhone

 On Jul 29, 2014, at 8:06 AM, Kyle Sluder k...@ksluder.com wrote:
 
 On Jul 29, 2014, at 1:58 AM, Gerriet M. Denkmann gerr...@mdenkmann.de 
 wrote:
 
 Master Detail app, works fine in 7.1.2.
 The Detail View has a UITextView.
 Whenever I get a Keyboard Notification (Changed) I change the height of the 
 TextView accordingly.
 
 All would be fine; but after all Notifications have been delivered and 
 before I can start typing, some evil agent resets the height of my TextView 
 back to the old (and now, with a keyboard present, much too big) value.
 
 Any ideas who would do such a thing to me?
 
 You can answer this question yourself. Subclass UITextView, override 
 -setFrame:, and set a breakpoint.
 
 Any known work-arounds?
 
 You probably shouldn't be changing the frame of your text view. Rather, set 
 its contentInset.
 
 --Kyle Sluder
 ___
 
 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/scottandrew%40roadrunner.com
 
 This email sent to scottand...@roadrunner.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: iOS 8 beta 4 messes with my TextView

2014-07-29 Thread Gerriet M. Denkmann

On 29 Jul 2014, at 22:06, Kyle Sluder k...@ksluder.com wrote:

 On Jul 29, 2014, at 1:58 AM, Gerriet M. Denkmann gerr...@mdenkmann.de 
 wrote:
 
 Master Detail app, works fine in 7.1.2.
 The Detail View has a UITextView.
 Whenever I get a Keyboard Notification (Changed) I change the height of the 
 TextView accordingly.
 
 All would be fine; but after all Notifications have been delivered and 
 before I can start typing, some evil agent resets the height of my TextView 
 back to the old (and now, with a keyboard present, much too big) value.
 

 Any known work-arounds?
 
 You probably shouldn't be changing the frame of your text view. Rather, set 
 its contentInset.

You are right (as was Scott, when he suggested that there was a tug of war 
between me and auto-layout).

Changing the old and bad:
text.frame.size.height += delta 
to the new:
text.contentInset.bottom -= delta
works much better indeed.

Works fine in both 7.1 and 8.0.

Thanks a lot for your help!


Kind regards,

Gerriet.


___

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