IOS博客项目搭建-06-自定义TabBarButton-03

一、按钮方法



二、按钮的图片、文字位置处理

  对按钮属性进行修改:

  // 底部图片居中
  self.imageView.contentMode = UIViewContentModeCenter;
        
  // 文字居中
  self.titleLabel.textAlignment = NSTextAlignmentCenter;
  
   // 文字大小
   self.titleLabel.font = [UIFont systemFontOfSize:11];

  

通过修改属性后,底部button离我们的新浪微博也越来越靠近了。






你可能感兴趣的:(ios,TabBarButton)