2012-10-26

Icon without Gloss Effects

In the projectName.plist file

Information Property List > Icon files (iOS5) > Primary Icon >

add "Icon already includes gloss effects" and set value YES

Setting Row Height in a TableView with Dynamic Content

開發小筆記


set text, font, constrain size and line break mode in advance
then check the size of the text

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *cellText = @"Go get some text for your cell.";
    UIFont *cellFont = [UIFont systemFontOfSize:23];
    CGSize constraintSize = CGSizeMake(280.0f, MAXFLOAT);
    CGSize labelSize = [cellText sizeWithFont:cellFont constrainedToSize:constraintSize lineBreakMode:UILineBreakModeWordWrap];

    return labelSize.height + 20;
}

Setting Object Always On The Top In a View

開發的小筆記

if the object is existed, using
-bringSubviewToFront:


else
-insertSubview:belowSubview:
-insertSubview:aboveSubview:
-insertSubview:atIndex: