设置UIBarButtonItem为自定义视图参考代码:characterCountLabel = [[UILabel alloc] initWithFrame: CGRectMake(0.0f, 0.0, 200.0f, 25.0f)]。