Skip to content


Fixed incorrect control's width #730

merged 1 commit into from

4 participants


When the control return YES in the method shouldConsiderControlIntrinsicSize, e.g. UISwitch, besides the position x should be set, the width also need to be updated.

You didn't observe any problem in the existing code since only the UISwitch is the candidate - it's width is fixed anyway, but when you extend to more controls, you will see the problem.


+1 for this fix, I also ran into this problem and used @tszming fix.
You can see this for example when you add UIButton to shouldConsiderControlIntrinsicSize.

+1 for this fix as well.


merged into development (1.0.11-dev)

@aporat aporat merged commit f371d14 into facebookarchive:development
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 1, 2011
  1. @tszming
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/Three20UI/Sources/TTTableControlCell.m
1 src/Three20UI/Sources/TTTableControlCell.m
@@ -167,6 +167,7 @@ - (void)layoutSubviews {
if ([TTTableControlCell shouldConsiderControlIntrinsicSize:_control]) {
minX += contentWidth - _control.width;
+ contentWidth = _control.width;
// XXXjoe For some reason I need to re-add the control as a subview or else
Something went wrong with that request. Please try again.