按钮宽度
/**
按钮宽度
*/
-(CGSize)buttonSizeOfTitle:(NSString*)title
{
NSStringDrawingOptions opts = NSStringDrawingUsesLineFragmentOrigin |
NSStringDrawingUsesFontLeading;
NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
[style setLineBreakMode:NSLineBreakByTruncatingTail];
NSDictionary *attributes = @{ NSFontAttributeName : [UIFont systemFontOfSize:ButtonFontSelectedSize], NSParagraphStyleAttributeName : style };
CGSize textSize = [title boundingRectWithSize:CGSizeMake(_topScrollView.bounds.size.width, TopScrollViewHeight)
options:opts
attributes:attributes
context:nil].size;
return textSize;
}