Welcome to the Three20 forums! Before you dive too deep into things, please read our forum rules.
A bug of TTTableTextItem when using UITableViewStyleGrouped TTTableViewController
  • Vote Up0Vote Down CroathCroath February 2012
    Posts: 1croath

    When using TTTableTextItem(or some other classes which are the subclasses of TTTableTextItem) in TTTableViewController, there will exist a bug. With Simulator or device basing on iOS4.3 is ok, problem happens in iOS5.

    in iOS 4.3: http://media.tumblr.com/tumblr_lz69bcDrhg1r6gbbu.png

    in iOS 5: http://media.tumblr.com/tumblr_lz69brENGk1r6gbbu.png

    yep you can see the white background of the text in such cells.

    According to the source code i found something in TTTableTextItemCell.m:

    - (void)setObject:(id)object {
    
        if (_item != object) {
    
        [super setObject:object];
    
        TTTableTextItem* item = object;
    
        self.textLabel.text = item.text;
    
        self.textLabel.backgroundColor = TTSTYLEVAR(backgroundTextColor);//here it is
    
        //some codes here………..
    
    }
    

    And then in the definition of TTSTYLEVAR i found:

    #define TTSTYLEVAR(_VARNAME) [TTSTYLESHEET _VARNAME]
    

    and in TTDefaultStyleSheet.m:

    - (UIColor*)backgroundTextColor {
    
        return [UIColor whiteColor];
    
    }
    

    so, it's clear that the function backgroundTextColor caught the problem. And the color changing is coded in the function

    - (void)setObject:(id)object;
    

    but not in

    - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)identifier, so it will be just fine in iOS4.
    

    I'm just a newbie of three20, so i'll apologize if there is anything wrong of my words.

    I also post this bug in my blog, but, in Chinese.

    Happy to learn and discuss.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with Twitter

Sign In Apply for Membership

Latest Three20 version: 1.0.5

Who's Online (0)