JXCustomButton.m 687 B

12345678910111213141516171819202122232425262728293031
  1. //
  2. // JXCustomButton.m
  3. // shiku_im
  4. //
  5. // Created by 1 on 17/8/15.
  6. // Copyright © 2017年 Reese. All rights reserved.
  7. //
  8. #import "JXCustomButton.h"
  9. @implementation JXCustomButton
  10. -(CGRect)titleRectForContentRect:(CGRect)contentRect{
  11. if (!CGRectIsEmpty(self.titleRect) && !CGRectEqualToRect(self.titleRect, CGRectZero)) {
  12. return self.titleRect;
  13. }
  14. return [super titleRectForContentRect:contentRect];
  15. }
  16. -(CGRect)imageRectForContentRect:(CGRect)contentRect{
  17. if (!CGRectIsEmpty(self.imageRect) && !CGRectEqualToRect(self.imageRect, CGRectZero)) {
  18. return self.imageRect;
  19. }
  20. return [super imageRectForContentRect:contentRect];
  21. }
  22. @end